565 Posted Topics

Member Avatar for sds234

This just doesn't work, your read the file into line one line at a time and each time overwrite the previous line before actually doing anything. Move the } below c++; down one line but still it doesn't do much. (other than actually print 1 lines 2 lines .... Normalize …

Member Avatar for StuXYZ
0
142
Member Avatar for Yuruke

In future please add the compiler error messages (well the first few). you seem to define your own iterators in spellcheck. That is going to cause problem LATER. pair<iterator,bool> requiires a complete type of YOUR iterator that is only pre-declared with the line [icode]class iterator;[/icode] Another problem is that [icode]list<EntryType>::iterator …

Member Avatar for StuXYZ
0
159
Member Avatar for CMacDady

Basically, don't try to do two things at once. You have (A) an array of Loanc and want (B) another array of Loanc. So [code=c++] int next(0); temp[0]=arr[0]; // MUST remember that you don't test the first for(int i=0;i<arrSz-1;i++) if (arr[i]!=arr[i+1]) temp[next++]=arr[i+1]; [/code] If arr is not sorted then you …

Member Avatar for CMacDady
0
109
Member Avatar for Undermine

Hope you don't mind an additional comment... If you shuffle the whole deck, you spend an amazing amount of time in the random number generator. It is a lot better (particularly for blackjack simulations -- where you only have a few cards to get out.), to generate the random cards …

Member Avatar for StuXYZ
0
594
Member Avatar for sfrider0

From the slightly overly-short section of code, (please post the rest of the while(!inFile.eof()) {.... }) I am guessing that you do not actually read any file. inFile.eof() only checks the state of the file (it is not at the end) If you do not have a readline / operator>> …

Member Avatar for StuXYZ
0
77
Member Avatar for monotone-mop

I am sorry but I laughed! However, we all begin somewhere. I can't say my early stuff was any good. [having said that I am not sure what I write today is that good.] First off: the ; (semi-colon) is a statement end. It doesn't actually matter were you put …

Member Avatar for monotone-mop
0
127
Member Avatar for tag234

The reason is that anArray is local to the scope of the function. So by the time that you use it with the ptr is it out of scope. Old compilers, use to allow this (without warnings), and no end of mayhem followed. To get round this, you can (a) …

Member Avatar for tag234
0
86
Member Avatar for Photomotoz

I think a little care in needed here. Poster #4 suggested making a heap object of A. [new A(5)] but that is maybe not what you want. It adds a level of complexity that might not be needed. You have to delete ob in B's destructor and manage the memory …

Member Avatar for StuXYZ
0
97
Member Avatar for CPPRULZ

Ok. There are two problems with this. First, you cannot declare variables within the outer scope of a switch statement. Hence lines 16 and 19 are illegal. Second you have declared "enumerator" both at 16/19 (a local copy) and at line 6. So you need [code=c++] enum daysinweek em; switch(whatday) …

Member Avatar for StuXYZ
0
150
Member Avatar for DLightman

First off I am going to deal with the minor errors. The the major problem. Number of minor errors: (A) Only constructors take the ":" assignment . Error in line 18 in destructor. It should read [icode] ~BinaryNode() {delete left; delete right;} [/icode] (B) Maybe delete line [icode] Compare compare …

Member Avatar for DLightman
0
155
Member Avatar for OhItsThatGuy
Member Avatar for scotchfx

The problem is that you can have the inline OR the declaration. You can't have both. So if you delete 5,6,7,8 all isl be fine. If you wish to define the function outside of the namespace definition then delete lines 10-17.

Member Avatar for StuXYZ
0
186
Member Avatar for DLightman

Ok the problem, that doesn't actually occur until you try to create a version of the BinaryNode (from BinarySearchTree) is that you have written: BinaryNode(Key k, T i) : data(i), Key(k) Note that [I]Key[/I] is now a type [From Line 6]. You need to use key. Or please use a …

Member Avatar for DLightman
0
125
Member Avatar for LustrousWS6

The error is almost certainly in CSimpleList.h BUT why is the guard around the CSimpleList.h. Three lines below, should and almost certainly are in CSimpleList.h #ifndef CSIMPLELIST_H #define CSIMPLELIST_H #endif //CSIMPLELIST_H That might be your problem, by setting the guard, you have avoided loading CSimpleList.h, since it has a repeat …

Member Avatar for StuXYZ
0
99
Member Avatar for rhoit

My guess is that you have a template that cannot be expressed as a float/double type e.g. [code=c++] template<typename T> void printout(const T& Obj) { print("%2f",Obj); } [/code] and then [code=c++] class SomethingComplex { .... }; SomethingComplex A; printout(A); [/code] There are many possible solutions but why not use the …

Member Avatar for StuXYZ
0
104

The End.