TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: JASON REYNOLDS
date: 1997-03-16 13:41:00
subject: Help with Classes

I use the following format to store and retrieve int's from a class.  I would 
like to know how to store and retrieve char's.  I've been unable to use 
char's in a class.  Could someone please help me out?
Class PlayerInfo
{
  Public:
    int  GetHitPoint() const { return itsHitPoint;}
    void SetHitPoint(int hitPoint) { itsHitpoint = hitPoint; }
  Private:
    int itsHitPoint;                    // characters Hit Points
};
void main()
{
  PlayerInfo Player;
  Player.SetHitPoint(40);
  cout << "Hit Points: " << GetHitPoint() << endl;
}
// end of example
--- Maximus 3.01
---------------
* Origin: The Other Side (605)342-7335/Rapid City SD (1:293/640)

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™.