15,300 Posted Topics

Member Avatar for NinjaLink

Well, what is wrong with the code you posted? Compiler errors/warnings? If yes, what are they?

Member Avatar for NinjaLink
0
1K
Member Avatar for afg_91320

1) delete all those unreferenced variables. They just clutter up your code and compiler err/warning messages. 2) after completing 1) then you can see the real errors. One of them is that you used ( when you should have used { in the opening function brace. The other is that …

Member Avatar for azy422
0
213
Member Avatar for jbennet

which part of USA is Scottland in ? Never heard of that state. :)

Member Avatar for sneekula
0
149
Member Avatar for n8thatsme

>>getline(cin, partDescrip); That should work ok assuming partDescrip is std::string. Why the program skips it is due to other parts of your program. If you have input for integers then you need to clean out the input keyboard buffer of the '\n' that is left. Right after the input integer …

Member Avatar for seanhunt
0
164
Member Avatar for jakethesnake86

your program does not allocate any memory for the line. And your program does way too much work! This is all that is needed. [code] std::string line; int i = 0; while( i < 7 && getline(inputfile, line) ) { i++; } cout << line << "\n"; [/code]

Member Avatar for jakethesnake86
0
484
Member Avatar for kamo10

lines 1, 10, 15, 23, 31, 50, 71, 95 and 100 are comments. So how is that related to the subject of this thread ?

Member Avatar for ithelp
0
123
Member Avatar for jkun2
Member Avatar for liquoriser21

Maybe you need to upgrade your GF to a newer model :) [quote] Some girlfriends do not need upgrading... just proper maintenance. However; if you have chosen a model that is not compatible with you, or if you have chosen a model that is beyond your means to afford/perform the …

Member Avatar for vegaseat
0
239
Member Avatar for uim_1977

First you will have to change the DLL to accept the parameters that you want. That means you will have to recompile the dll with the new set of parameters.

Member Avatar for uim_1977
0
187
Member Avatar for Alex Edwards

I only carry one credit card -- leave the other one million cards on my bedroom dresser. I carry it to buy gas and other things I see while shopping. Then I always pay the entire balance when I get the bill so that I don't have to pay intgerest.

Member Avatar for Alex Edwards
0
158
Member Avatar for Tshiamo

[URL="http://www.microsoft.com/express/vc/"]vc++ 2008 Express[/URL] [URL="http://www.bloodshet.net"]Dev-C++[/URL] I know there are others. All C++ compilers also compile C code, so you don't need separate compilers for that. For more information and helpful stuff see the [b]Read Me[/b] threads at the top of the C++ board.

Member Avatar for Code Shark
0
83
Member Avatar for Traicey

depends on how fancy you want the print job. [URL="http://www.codeproject.com/KB/printing/printingmadeeasy.aspx"]Here's one solution[/URL] that does not require MFC. That site has other c++ classes so just put "printer" in their search bar.

Member Avatar for Ancient Dragon
0
47
Member Avatar for kenji

how is accountNumber declared? delete line 12 because the previous loop copies the null terminator into the array.

Member Avatar for kenji
0
83
Member Avatar for panpanf

Its better to not write assembly language at all -- just let the compiler do the work for you. There is little, if anything, to be gained by hard-coding assembly language into a c++ program. And it makes porting to other operating systems next to impossible.

Member Avatar for Ancient Dragon
0
89
Member Avatar for m_arian

lines 214-218: This will not work because the [b]new[/b] operator does not return 0 when memory allocation fails -- it throws an exception. If you want to check for that then you need to use try/catch blocks. The code you posted is a good example of the MISUSE of unions. …

Member Avatar for skatamatic
1
125
Member Avatar for f.ben.isaac

you are missing a header file -- see example program [URL="http://msdn.microsoft.com/en-us/library/ms738520.aspx"]here[/URL]

Member Avatar for f.ben.isaac
1
497
Member Avatar for jianna

how did that even compile? It is missing two closeing } character. Assuming that is just a posting error the code looks ok to me.

Member Avatar for jianna
0
461
Member Avatar for ammenme

TextPad is not an IDE for compilers, but just a text editor. If you want to learn c++ then use a real compiler, such as free [URL="http://www.microsoft.com/express/vc/"]VC++ 2008 Express[/URL]

Member Avatar for Ancient Dragon
0
44
Member Avatar for Niner710

since this is c++ why use pointers? Just make name and message both std::string and that will probably solve the memory leek problemn.

Member Avatar for skatamatic
0
171
Member Avatar for jhonnyboy

The >> operator stops at the first space. To get everything you need to use getlin(). There are two versions: one for std::string and the other for character arrays. [code] cout<<"ENter name"<<endl; getline(cin, name); // assum name is std::string cin.getline(name, sizeof(name)); // assumes name is a character array [/code]

Member Avatar for Ancient Dragon
0
6K
Member Avatar for jackstevens_100

I hope your boss knows that and is rewarding you handsomly for spending so much time at work. Are there shower facilities there too ????? Don't want your boss and other people thinking there is a dead mouse rotting in that room :)

Member Avatar for enVigil
0
212
Member Avatar for mrbiggbrain

The program won't work if the file has fewer than [b]line[/b] number of lines. Here's one way to correct that [code] int i = 0; while(i < line && getline (current_file, current_line)) ++i; if(i != line) // if error return ""; // return blank line return line; [/code]

Member Avatar for Sci@phy
0
120
Member Avatar for Bhoot

>>Does CWnd::GetClientRect() include the toolbar region? Not sure if it does or not. Try using CWnd::GetWindowRect() and see if that fixes the problem.

Member Avatar for Bhoot
0
199
Member Avatar for The Dude

The problem isn't the boy -- he's not old enough to give consentual sex. But the teacher will probably spend several years behind bars, spend the rest of her life on the sexual offense roster, and her teaching career is over. She runed her life for a few minutes of …

Member Avatar for GrimJack
1
844
Member Avatar for buddha527

Your last statement is how its normally done. Create one object then call all its methods as necessary. If you declare the methods static then you don't have to create an instance of the object in order to call the function [code] class A { public: static int getBeta(); }; …

Member Avatar for buddha527
0
112
Member Avatar for GrimJack
Member Avatar for sleign

Maybe you are using the wrong compiler. [URL="http://www.microsoft.com/express/vc/"]Download VC++ 2008 Express [/URL]and compile your program for UNICODE (which is the default with that compiler)

Member Avatar for Ancient Dragon
0
138
Member Avatar for royk76

line 36 in your post should be [icode]int FHF::m_id = 0;[/icode] You have to declare it with a data type just like you would any other global variable.

Member Avatar for Ancient Dragon
0
110
Member Avatar for mammoth

using ctime functions will consume a lot of CPU time. Instead its better to call the os Sleep() function (MS-Windows) or sleep() (*nix). [code] #include <iostream> #include <windows.h> int main() { while(true) // infinite loop { system("start alarm.wav"); Sleep(30 * 1000); // delay 30 seconds } } [/code]

Member Avatar for Ancient Dragon
0
67
Member Avatar for jbennet

I don't get that problem with either IE7 (64-bit version) or FireFox version 3.0.3

Member Avatar for jbennet
0
53
Member Avatar for nimasafa
Re: Help

Error 1: that error message always means that you have mis-matched { and } or parentheses. Count them and make correction. Error 2: correct error #1 and this will be fixed too.

Member Avatar for WaltP
0
135
Member Avatar for Tayprogramming

word alignment -- [URL="http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/aligned.html"]click here[/URL] >>Which Library do we work perfectly with a big integer There are no standard c or c++ libraries that will do that. But [URL="http://www.google.com/search?hl=en&q=large+integer+libraries&aq=f&oq="]click here [/URL]for others.

Member Avatar for Denniz
0
110
Member Avatar for gmdune

>>.I am re-posting my code This is your first post -- so how can that be ??? >>The code runs correctly, but the ending balance, after all the withdrawals, is incorrect Then it doesn't run correctly, now does it?? What compiler are you using? VC++ 2008 Express produces a couple …

Member Avatar for Salem
0
210
Member Avatar for bone7_7

lines 13 and 14 are in reverse order. The { goes after the while statement, not before. line 28 -- break -- is wrong because it is not inside any loop where a break is valid. Here is how the function should work [code] top of loop enter variable x1 …

Member Avatar for Ancient Dragon
0
113
Member Avatar for imput1234

You have to download and install the [URL="http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en"]Windows Platform SDK [/URL]free from Microsoft. Or download and install[URL="http://www.microsoft.com/express/vc/"] VC++ 2008 Express[/URL], which has what you need.

Member Avatar for Ancient Dragon
0
81
Member Avatar for StainlessSteelR

About program formatting: Don't write a program that is straight down the left-hand side of the screen like you have posted. Indent the lines so that they are easier to read and understand. About functions -- [URL="http://computer.howstuffworks.com/c12.htm"]see How Stuff Works[/URL]

Member Avatar for Ancient Dragon
0
94
Member Avatar for robgeek

you can not copy one character array to another using the = operator -- that only works with std::string. The assignment wants you to copy the string in reverse order. The only way to do that is one character at a time, something like you did in the previous line …

Member Avatar for Ancient Dragon
0
250
Member Avatar for three6mtaw3a

>>Dudes Wuudup?? This isn't a chatroom. Write in English, not some sort of chatroom talk. Assuming the target operating system is MS-Windows, [URL="http://www.winprog.org/tutorial/"]read this tutorial.[/URL]

Member Avatar for Ancient Dragon
0
65
Member Avatar for Se7Olutionyg

line 28: remove [b]void[/b] -- when calling a void function just have (), such as [icode]displayMenu();[/icode] line 40: function name is misspelled. Check capatialization.

Member Avatar for Ancient Dragon
0
131
Member Avatar for shindog3

Your program has mismatched { and }. If you would use better formatting then such errors will be easier to find. As it is, it is very difficult and time consuming to find matching { and }. Here is an example of what I suggest: [code] for(i=1; i <= totalDates; …

Member Avatar for chococrack
0
186
Member Avatar for Jason123

If the user keys in more than just a single character you can flush the input keyboard buffer of all remaining keystrokes. See [URL="http://www.daniweb.com/forums/thread90228.html"]Narue's article here[/URL] about how to do that.

Member Avatar for Jason123
0
181
Member Avatar for Shanebear

line 8: you have to declare a variable name inside the parentheses. line 26: [b]else[/b] should not be capitalized.

Member Avatar for Evan M
0
115
Member Avatar for Jahira
Member Avatar for morais

Post the line of code that caused that error because I'm not a mind reader or clairvoyant.

Member Avatar for Ancient Dragon
0
282
Member Avatar for FtKShadow

He is asking you to write two functions named [b]min[/b] -- The parameters to one of the functions will be two integers, while the parameters to the other function will have three parameters. That is called function overloading -- more than one function with the same function name but different …

Member Avatar for Ancient Dragon
0
114
Member Avatar for serkan sendur

I don't think it would work here because it would not have enough traffic to make it viable. DaniWeb is devoted to IT related issues. I'm sure you can find other suitable web sites for help with electrical engineering.

Member Avatar for MidiMagic
0
109
Member Avatar for sarah_ella

The input file is opened in text mode, which means your program will never see the '\n' character(s) because getline() will filter it out, leaving only the characters up to but not including '\n'. That read loop is wrong anyway because eof() doesn't work that way. [code] while (getline(infile, tmp)) …

Member Avatar for sarah_ella
0
185
Member Avatar for hugoboss911

you need to use the win[URL="http://msdn.microsoft.com/en-us/library/aa363196(VS.85).aspx"]32 api communications functions[/URL]

Member Avatar for Freaky_Chris
0
152
Member Avatar for dtaylor01

C and C++ do not have "END IF" statements. [code] int score; char grade =0; // read in total score cout << endl; cout << "Enter total score (float, must be <= 100): "; cin >> score; if (score >= 85); grade = 'A'; else if (score >= 75); grade …

Member Avatar for chococrack
0
247
Member Avatar for asifjavaid

Are you doing command-line builds or building in the IDEs ? If command-line builds then you have to set up the environment for each compiler by running the vcvars32.bat file in the compiler's bin directory.

Member Avatar for Denniz
0
227

The End.