Ask your own question, for FREE!
Mathematics 20 Online
OpenStudy (anonymous):

Is it alright if I implement getter/setter methods in the C++ class header file itself, and not in the .cpp file?

OpenStudy (anonymous):

as in here: #include <string> using namespace std; class patient { public: patient(); patient(int Id, string Name, int Age); patient(string Name, int Age); virtual ~patient(); patient(const patient& other); int getID() { return ID; } void setID(int val) { ID = val; } string getName() { return Name; } void setName(string val) { Name = val; } int getAge() { return Age; } void setAge(int val) { Age = val; } private: int ID; string Name; int Age; };

OpenStudy (jamesj):

Only on Wednesdays and second Sundays. Seriously, this is a question for some Computer Science forum.

OpenStudy (anonymous):

But it's empty there :(

OpenStudy (anonymous):

I'm sure lots of math types are good with C++

OpenStudy (anonymous):

nope, we use assembly

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!