I am Really new to c++ and intimidated. MY class is returning errors and i do not know why? I think my header files are correct but my .cpp files i am struggling with.
//This is my base class header file.How should the GenShape.cpp file look?
Please Help I am dying!!
[code]
class GenShape //Base Class
{
private:
int perimeter;
public:
GenShape();
GenShape(int p);
~GenShape();
int getPerimeter() const;
void setPerimeter(int p);
What the hell man? Why would I Lie, Its Pointless. I tried adding a default constructor, Go to that thread and tell me did I mark it as solved? Did I say anywhere Solved?
And yea the difference is i added the cpp file there which doesnt work , or maybe you dont know the difference between a cpp file and an h file?
So while I wouldn't say you are lying... ne555 is correct in that this is not the code you are compiling. Because if it were, you would not be getting this error.
What's probably happening is you are not compiling the code you think you are. This can be caused by a few things.
1) Maybe your IDE screwed up and is hanging onto old cached files. Do a clean and/or rebuild
2) Maybe you have multiple header files, and you are #including an outdated one. If your IDE allows, right click on the #include line and say "open file". Check the path of that file and make sure it's the file you want.
probably some other stuff could cause it too, but that's all I can think of at the moment.