Hey this is an awesome forum, now I am having a problem with a class i am building. I get error C2065 which is the undeclared identifier. My header look like this :
Sorry nevermind I figure it out. So sorry.
Hey this is an awesome forum, now I am having a problem with a class i am building. I get error C2065 which is the undeclared identifier. My header look like this :
Sorry nevermind I figure it out. So sorry.
Last edited by naroken; 04-29-2009 at 10:35 AM. Reason: figure it out
I dont know how to delete it after i posted it too. anyone know how to?
Those function names need Food:: in front of them.Code:void setName(string a) { name = a; } string getName(void) { return name; } void setCalories(int b) { calories = b; } int getCalories(void) { return calories; } void setFat(int c) { fatCal = c*9; } int getFat(void) { return fatCal; } void setTotalCal(int d, int e) { d = fatCal; e = calories; totalCal = d + e; } int getTotalCal(void) { return totalCal; }
Also, the getter functions should be declared const and you should avoid putting a using namespace directive in a header file (explicitly qualify any std namespace objects as necessary).
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens