TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JASON REYNOLDS
from: THOMAS MAEDER
date: 1997-03-18 19:33:00
subject: Help with Classes

JR> I use the following format to store and retrieve int's from a class.
I bet you don't. class, public and private don't start with a  capital
letter. This might be a "feature" of your offline reader, though.
JR> like to know how to store and retrieve char's.  I've been unable to
JR> in a class.  Could someone please help me out?
If I understand you right, you want the member itsHitPoint  to  be  of
type char instead of int? If I remember right, you asked this question
a week ago already, and there were several correct answers.
JR> Class PlayerInfo
JR> {
JR>   Public:
JR>     int  GetHitPoint() const { return itsHitPoint;}
JR>     void SetHitPoint(int hitPoint) { itsHitpoint = hitPoint; }
JR>   Private:
JR>     int itsHitPoint;                    // characters Hit Points
JR> };
Just replace all three occurrences of int with char.
Thomas
---
 þ MM 1.0 #0113 þ How do you know it's summer in Seattle? The rain is warm!
---------------
* Origin: McMeier & Son BBS (2:301/138)

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