15,300 Posted Topics

Member Avatar for db11

One problem is that you included <string> but failed to specify std namespace. line 975: [icode]std::string blabla[/icode]

Member Avatar for db11
0
247
Member Avatar for saphira

And what specifically is the problem? The only thing I see wrong is that you need to prototype each of those functions that are being called in that switch statement. Otherwise looks like it should compile and work ok.

Member Avatar for Salem
0
4K
Member Avatar for aarti_gehani
Member Avatar for greg022549
Re: help

It won't compile because you commented out a class method in the header file. Look at the error line number, then look at the header file to see where that function is declared. Its commented out!

Member Avatar for siddhant3s
0
87
Member Avatar for homeryansta

put all the operators in a character array then use strchr() to see if a character is one of the operators. [code] const char operators[] = "/*+-()"; while( !empty_optr() && ischar(operators, top->data_optr)) { // blabla } [/code]

Member Avatar for homeryansta
0
117
Member Avatar for aarti_gehani
Member Avatar for Mazor

[code] while(!fis.eof()) { lines2++; fis >> str; } [/code] two problemss: 1) that counts the number of words, not lines. If you really want lines then call getline() 2) That will count the last line/word twice because eof() doesn't work lilke that. Here's how to code the loop [code] while( …

Member Avatar for Mazor
0
99
Member Avatar for hellIon

Post your version of that file. Mine doesn't have INT64 on line 17. Or maybe you should use a different compiler, such as free Microsoft VC++ 2008 Express.

Member Avatar for Ancient Dragon
0
393
Member Avatar for ToniB88

So you think we are going to tell you how to write a bot to spam everyone, including DaniWeb? :D

Member Avatar for Ancient Dragon
0
21
Member Avatar for ZeRo 00
Member Avatar for Ancient Dragon
0
84
Member Avatar for JP Romano

1) you could store them in different directories. 2) extract a file, rename it, then extract another file. Do that for each of the zip files.

Member Avatar for vb5prgrmr
0
163
Member Avatar for theimben

you could always copy/paste into your own favorite editor, such as Notepad++ which will do what you are looking for.

Member Avatar for verruckt24
0
150
Member Avatar for JameB

I don't know the purpose of all those for loops. If all you want to do is erase the '~' characters then just do that [code] for(int i = 0; i < inp.length(); i++) { if( inp[i] == '~') inp.erase(i,1); } [/code]

Member Avatar for GDICommander
0
134
Member Avatar for kleinsun

Do you have write permissions on that computer and directory? Try to copy manually and see if it works.

Member Avatar for mitrmkar
0
2K
Member Avatar for slimjimmer

I think it would be easier to validate user input by getting it as a string then validating the string. For example, if I type "122abv234", scanf() will only pick up the first three characters and ignore the rest with no warning. But if you validate that as an array …

Member Avatar for Salem
0
2K
Member Avatar for RogueeZ

never heard of ragnarok, but I played Diablo LOD for many years until I installed Vista -- won't play on Vista.

Member Avatar for Nick Evan
0
126
Member Avatar for homeryansta

[QUOTE=ithelp;815365]Sometime newline ends with ^M .[/QUOTE] Its not a matter of "sometimes". It either does, or it doesn't, depending on the operating system. '\n' translates into whatever the operating system uses as end-of-line. MS-Windows: "\r\n". *nix: "\r". Not sure what MAC uses.

Member Avatar for DemonGal711
0
296
Member Avatar for RogueeZ
Member Avatar for Dontais

you can't call the constructor like you did in main()) [code] int main() { Bicycle myBike(24,17); myBike.printBicycle(); return 0; } [/code]

Member Avatar for Dontais
0
107
Member Avatar for slimjimmer

I assume [b]table[/b] is an array of integers? Yes? If you want the numbers aligned up right then add width fields [icode]printf(output, "%10d %10d", ...)[/icode] will print them right justified in a 10 character field. If you want them left justified then add - character [icode]printf(output, "%-10d %-10d", ...)[/icode]

Member Avatar for csurfer
0
158
Member Avatar for power_computer

>>if (gross1, gross2, gross3, gross4, gross5 < THREE_HUNDRED){ That is not the right way to code it. The compiler doesn't complain because its syntaticlly correct -- the comma operator says only gross5 is compared to THREE_HUNDRED Correct the problem like this: [icode]if (gross1 < THREE_HUNDRED || gross2 < THREE_HUNDRED || …

Member Avatar for vmanes
0
79
Member Avatar for xonxon

The two lines are different. In the first line, arrowlink is of type newNode, while in the second line it is of type q. The two statements are the same only if newNode and q are two different names for the same thing.

Member Avatar for Ancient Dragon
0
47
Member Avatar for deerowbear

The very first error message should have told you that AVLNode is undefined

Member Avatar for Ancient Dragon
0
103
Member Avatar for johnray31

you have two objects with the same name. You can only overload functions, not data objects.

Member Avatar for johnray31
0
187
Member Avatar for Fouly

you should have received a compile-time error on that line because it's syntically incorrect -- _T( macro is never closed, needs a ) before the comma.

Member Avatar for Fouly
0
162
Member Avatar for anbuninja

The prototypes do not match the actual functions. Compare them and you will see what's wrong. After that you should realize that you can't pass string literals as you did to those functions -- must pass a reference to std::string object.

Member Avatar for vmanes
0
174
Member Avatar for JoannaMeier

you can delete pointer p since its not needed [code] while (fread(&records[totalcount],sizeof(entrant),1,fp)) { if (totalcount+1 == curmax) { curmax+=memincrement; records = realloc (records,curmax * sizeof(entrant)); } totalcount++; } [/code] In C language, malloc() doesn't need a typecase. Or you could use a linked list.

Member Avatar for Ancient Dragon
0
103
Member Avatar for waldchr
Member Avatar for GadiK

1) try commenting out large sections of code until no more leaks detected. 2) Sometimes it reports leaks that are not really leaks. such as memory allocated by MFC classes or your own code and not yet released when CrtDumpMemoryLeaks() is called.

Member Avatar for Salem
0
893
Member Avatar for zacknie

Please stop calling us "boss". We aren't your boss. To initialize the array to zeros: [icode]double qty[10] = {0.0};[/icode] But qty shouldn't be an array of ints instead of doubles, or are you allowed to buy fractions of sojmething?

Member Avatar for zacknie
0
141
Member Avatar for guest7

try this: the compare function isn't needed. [code=cplusplus] string junk; string junk1 = "cls"; while( inFile >> junk && junk != junk1) ; [/code]

Member Avatar for Ancient Dragon
0
113
Member Avatar for avadhut_ekal

Yes, ODBC is the oldest and most widely used method, but not the fasted. There are a few free ODBC C++ classes out there too that will help simplify the job-- just google for them.

Member Avatar for hasbro
0
146
Member Avatar for ellimist14

You first have to declare variables to hold each of the numbers. Then just use the stream's >> operator to read from the file into the number [code] int SalespersonID, ModelCode, Count, Sold; ifstream in("filename.txt"); while( in >> SalespersonID, >> ModelCode >> Count >> Sold) { // blabla } [/code]

Member Avatar for siddhant3s
0
126
Member Avatar for Hillcoat

I compiled it with VC++ 2008 Express on Vista Home and got the below output. Didn't get the error you reported. [code] In gallons/min, what is the flow rate: 1 In inches, what is the diameter of your pipe: 2 What material is your pipe made of? The materials are …

Member Avatar for Ancient Dragon
0
86
Member Avatar for blahblah619

post the input file. You probably don't need those ignore() lines, unless there is other text on each of the lines after the number. The >> operator will ignore all spaces and the '\n' line terminating character(s).

Member Avatar for siddhant3s
0
271
Member Avatar for greatcdm

Welcome to DaniWeb, Chris. Hope you have a lot of fun here, learn a few things, and hopefully be able to help others.

Member Avatar for Robdale
0
20
Member Avatar for aashishn86

You can't, and we normally don't either unless it villates one or more of the DaniWeb Rules.

Member Avatar for aashishn86
0
56
Member Avatar for cppnewb

those error messages are correct. Did you look up those functions in msdn to see what are their parameters? If not, then you should do so. You have to be careful about those non-standard Microsoft functions. Microsoft declared many standard C functions depreciated, the c and c++ standards made no …

Member Avatar for cppnewb
0
1K
Member Avatar for Ancient Dragon

I just saw these interesting new articles on nother of my favorite sites and thought I'd share.

Member Avatar for Will Gresham
0
28
Member Avatar for kshitijkapoor

I think first you have to understand how the 2nd system is going to display the values: If system 1 has 5.123 what is system2 going to do with it? should system1 send 5123, or just 5, or what?

Member Avatar for death_oclock
0
126
Member Avatar for nagha3

So what is the problem you are having? To get the average just add them up and divide by the number of grades -- 4th grade math.

Member Avatar for Ancient Dragon
0
107
Member Avatar for BruenorBH

It has been my experience that windows can only be updated in the thread in which they are created. What I have done to resolve your problem is for thread2 to send a message to thread1 so that the window can be updated by thread1. See [URL="http://msdn.microsoft.com/en-us/library/ms644946(VS.85).aspx"]PostThreadMessage()[/URL]

Member Avatar for BruenorBH
0
149
Member Avatar for bugmenot

If you are not allowed to use vector then you will have to read the entire file, counting the line numbers as the loop progresses. There is no other way to do it. Why do you need the line count? Maybe there are alternative ways to achieve what you want …

Member Avatar for Ancient Dragon
0
136
Member Avatar for qinise4
Member Avatar for BimanD

Are you in school, is this homework? If yes, then read your textbook and you should find the answers yourself.

Member Avatar for Ancient Dragon
0
57
Member Avatar for prashanth s j

It does not caluse a memory leak, but both pointers are invalidated after the free.

Member Avatar for Ancient Dragon
0
48
Member Avatar for acardiac

[code] // line 286: void DelRec(Passport pass[NUM],int pptNo)//definition of modifyRecord { for(int i=pptNo;i<NUM;i++) { [/code] pptNo is supposed to be the passport number of the record to be deleted. Right? If yes, then why is the for loop initializing variable i to pptNo? If you look at the addRec() function …

Member Avatar for Ancient Dragon
0
240
Member Avatar for Rashakil Fol

I like the idea of being able to specify the number of rep points I could give someone. I'm more concerned about bad rep -- I rarely give out bad rep because I don't want to destroy their overall rep points. It would be like running over an ant hill …

Member Avatar for happygeek
0
169
Member Avatar for meistrizy

your loop is doing too much work. [code] char codes[] = "qwertyuiop"; string dCode = "wtu"; // hard-code search value for(int i = 0; i < dCode.size(); i++) { for(int j = 0; codes[j] != 0; j++) { if( dCode[i] == codes[j]) { cout << codes[j-1]; break; } } } …

Member Avatar for meistrizy
0
166
Member Avatar for FTProtocol

Call [URL="http://msdn.microsoft.com/en-us/library/ms633497(VS.85).aspx"]EnumWindows[/URL]() to get a list of all the top-level windows so that you can get the handle to the browser window. The problem is -- how will you know which one is the browser?

Member Avatar for fskreuz
0
1K

The End.