Nevermind. Sorry.
See VVVVVVVVVVVVVVVV
jonsca
Quantitative Phrenologist
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
Thanks for trying to use [code=syntax] ... code tags ... [/code]. They didn't work because your closing tag is incorrect. Take out the "=syntax" part and they should work.
You have duplicated your class declaration. When you define a member function in a source file (a *.cpp file) that is separate from the header file (a *.h file) you do not re-use the "class" keyword. Instead you use the class name and the "scope resolution operator" ( '::' ).
Example:
//class.h
class myClass {
private:
int prvInt;
public:
myClass(); //default constructor
myClass(int); //specified constructor
};
//class.cpp
#include "class.h"
myClass::myClass() { //default constructor
prvInt = 0;
}
myClass::myClass(int newPrvInt) { //specified constructor
prvInt = newPrvInt;
}
Your main would be as normal.
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393