Sorry mate I meant to say it was my .h file not cpp.
My class already has the guards. Just didn't include them because I didn't know they were important.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef HUMAN_H_INCLUDED
#define HUMAN_H_INCLUDED
#endif // HUMAN_H_INCLUDED
class Human
{
public:
void setID(int identity);
int getID();
private:
int identity;
};
The declaration should be between the #define and the #endif directives. Otherwise the include guard is useless. Could you post the entire customer.h file?
Use my examples above as a start, then copy whatever is between the curly braces for each class into the place I filled with a comment (// ... ). Pay attention to the names of the files.
Ty mate, got it compiling now, I'll figure out something to use in main to double check its working later. Thanks alot :). Better go read up about "guards" now.