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)
|