Jason Reynolds, All, 27 Feb 97, 14:07
JR> public:
JR> int GetAge() const { return itsAge; }
JR> void SetAge( int newAge ) { itsAge = newAge; }
JR> int itsAge;
JR> Which works fine for setting and getting the int value for the program.
JR> My problem is when I try to use a char??? How would I do the same thing
JR> but for a char?
First, just to simplify the code, you could use the same function for
both setting and getting the information (like: int age(), void age(int) ).
As for your problem, if I got it right, youu simply have to do:
void age(char newAge) { itsAge = (int)newAge; }
Was THAT the problem, or haven't I got it right?
--- FMail/386 1.02
---------------
* Origin: , (2:407/10)
|