TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JASON REYNOLDS
from: URI TIDHAR
date: 1997-03-12 14:59:00
subject: Class & Char

   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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.