Home › Forums › C Programming › NEED HELP URGENTLY !!!! › Reply To: NEED HELP URGENTLY !!!!
June 2, 2008 at 1:54 pm
#3399
Humayan
Participant
Do you mean a constant method of a class implementation? A constant member function of a class is a function that does not alter any class data members , like:
1 2 3 4 5 6 7 8 | class X<br /> {<br /> public:<br /> int age() const { return mAge; } //const get method<br /> void age(int age) { mAge = age; } //( accessor! )<br /> private:<br /> int mAge;<br /> }; |
check out this link: http://www.uwyn.com/resources/uwyn_cpp_coding_standard/x496.html