Is it alright if I implement getter/setter methods in the C++ class header file itself, and not in the .cpp file?
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; };
Only on Wednesdays and second Sundays. Seriously, this is a question for some Computer Science forum.
But it's empty there :(
I'm sure lots of math types are good with C++
nope, we use assembly
Join our real-time social learning platform and learn together with your friends!