--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00006 Date: 03/16/97 From: JASON REYNOLDS Time: 01:41pm \/To: ALL (Read 7 times) Subj: 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) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00007 Date: 03/16/97 From: JEAN-POL LANDRAIN Time: 10:07am \/To: JERRY COFFIN (Read 7 times) Subj: C++ Formatted Output Salut Jerry, Jerry Coffin crivait le Mardi 04 Mars 1997 Jean-Pol Landrain : JL>> Could you remember me how to write a manipulator with two JL>> parameters ? I can't remember how to do it. JC> With what compiler? Older versions of iostreams use macros while a JC> few that are up-to-date use templates. Of course, the code for each JC> is a bit different from the other... With BC++. I remember wich macro I have to use for a manipulator with one parameter, but I can't remember how to do with two parameters. Amitis, Jean-Pol --- GoldED/386 2.50+ * Origin: Mininet 97 +32(0)87/88-33-44 - Cimes (2:293/4004.104) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00008 Date: 03/06/97 From: ROGER SEN MONTERO Time: 11:50pm \/To: DANIEL JONES (Read 7 times) Subj: WHAT IS STL? Hola Daniel! 23 Feb 97 08:23, Daniel Jones wrote to Roger Sen Montero: DJ> I'm not familiar with SGI. Is this a commercial product? If it's DJ> freely distributable, where can I pick up a copy? SGI = Silicon Graphics. Saludos. Roger. - rogersm@bbs-ce.uab.es http://tau.uab.es/~rogersm ... With her killer graces, and her secret places... --- FMail/386 1.0g * Origin: (2:343/128.15) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00009 Date: 03/16/97 From: GERRY DANEN Time: 05:02pm \/To: PATRICK GLENN (Read 7 times) Subj: Dialog went where? JC>This is fairly simple. Start by putting a static text control in the PG> JC>BTW, this really doesn't have much to do with C++ itself - you might JC>want to take a look to see if the WINDOWS.PROG echo is available at your JC>BBS. This is what you were talking about. I'll see if I have it, and let you know, but not in this echo. I'll be off-topic here and Mr. Moderator might not like me for that. Gerry Danen gdanen@accessweb.com CompuServe: 102736,3352 ... Your IQ test came back, It's Negative. --- Maximus 3.01 * Origin: C+Net BBS. Programming & Networking. (1:342/1017) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00010 Date: 03/13/97 From: SHAMIM ISLAM Time: 09:53pm \/To: SARAH NUNEZ (Read 7 times) Subj: Basic SN> SI> No. It's too big. SN> The demo?! How big are we talking? Ummm...I think it was 14MB. * RM 1.3 02587 * RoboMail -- The next generation QWK compatible reader! --- Maximus/2 3.01 * Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00011 Date: 03/13/97 From: SHAMIM ISLAM Time: 09:50pm \/To: JERRY COFFIN (Read 7 times) Subj: Turbo C++ vs. C++ JC> SI> Compilers are written in response to language definition. Not t JC> SI> other way around. If compilers defined languages, we wouldn't n JC> SI> BNF grammars. :) JC> Playing my usual position of devil's advocate: the original definiti JC> of LISP was a LISP interpreter, which was itself written in LISP. T JC> legal syntax was anything it would accept, and the definition of the JC> semantics was what it did. No compiler or interpreter is possible to be written at the basest level within the same language framework, without a basic engine written in a pre-existing language. Even if it was done in assembly first, it was done in something else before it was done in the 'language'. C is compiled in C. C++ can be compiled in C++. Or in C. I'm sure LISP didn't just exist. Therefore it stands to reason that LISP, although can be used to write LISP interpreters, was not done that way the first time. JC> Nicely enough, LISP is quite an easy language to interpret, and also JC> lends itself well to writing interpreters, so the "definition" was l JC> than one page long... I'd be interested in getting that definition. Do you have it lying around somewhere? * RM 1.3 02587 * RoboMail -- Version 1.3 -- Available now! --- Maximus/2 3.01 * Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00012 Date: 03/15/97 From: HENK DEUTEKOM Time: 11:50am \/To: MARK PYNE (Read 7 times) Subj: WANTED BC++ OLD VERSION! To: overflow@ndirect.co.uk From: hdeutekom@bundy.idn.nl (Henk Deutekom) Date: Saturday, March 15, 1997, Time: 11:50 WET Subject: WANTED BC++ OLD VERSION! Hello Mark Pyne! Tuesday, March 11, 1997, Mark Pyne wrote to All: MP> Hi, MP> I am after Borland C++ v3.x (prefably v3.1) MP> I am not bothered about the manuals or the box, just the disks! MP> They can be on 3.5", 5 1/4, CDROM or even a tape backup ! MP> If you've got a version lying around (or just the disks!), MP> please get in touch via netmail, e-mail (overflow@ndirect.co.uk) MP> or voice on 0116 2718335. MP> If the price is reasonable, the cheque will be in the post the MP> same day ! MP> (no version 4's or above please, I have 4.5 already but MP> unfortunatly I have a program which has 1mb of code that doesnt MP> like the later versions and as I only need to make a few custom MP> changes, its not worth me re-writing the whole program!) Next message in C++ area: == Knip === [2] C_PLUSPLUS (2:283/6.22) C_PLUSPLUS Msg : 50 of 65 -35 Loc From : Henk Deutekom 2:283/6.22 14 Mar 97 10:28:00 To : Kevin Sheetz Subj : BORLAND C++ FOR DOS V3.0 >> C_PLUSPLUS << Friday, March 14, 1997 Hello Kevin! Monday, March 10, 1997, Kevin Sheetz writes to All: KS> Need Borland C++ for DOS Version 3.0. Must have all documents. Any KS> offer is acceptable. I have here (a registered) CD Rom version 3.1 with Application Framework, also the (registered) CD Rom version 4.1. All documents are on the CD Rom's. Also available the (13) floppy version of 3.1 (original en registered), with all known pathes (3), the 286 DOS extender version 2.5 from Phar Lap. No pirates! I wish to have the 5.0 or 5.1 (original) CD Rom version. Is 't possible to switch without payment? I make this offer because of disappointment of Visual C++ 4.2 of Microsoft. I am flabbergasted. Visual Basic examples in a C++ programming environment! What is MS doing!? Are they crazy? I am going back to Borlands C++. Regards, Henk E-mail: hdeutekom@bundy.idn.nl === Knip === Also accepting other programming software (NO pirates, only originals). Regards, Henk --- FMail/386 1.02+ & GoldED/386 2.50+ * Origin: Loc (2:283/6.22) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00013 Date: 03/16/97 From: CLIFF RHODES Time: 10:11pm \/To: JASON REYNOLDS (Read 9 times) Subj: Help with Classes --> Jason Reynolds wrote to All <-- JR>I would like to know how to store and retrieve JR>char's. I've been unable to use char's in a class. Could JR>someone please help me out? Jason, I would assume you are interested in arrays of chars rather than single chars. If you have a newer compiler, you can use the C++ String class. Look for it in your documentation. If you don't have it, you can do something like the following: #include #include class PlayerInfo { public: // Add these to support array of chars PlayerInfo() { itsStr = 0; } // Set pointer to 0 ~PlayerInfo() { if(itsStr) delete [] itsStr; } // Free mem int GetHitPoint() const { return itsHitPoint;} void SetHitPoint(int hitPoint) { itsHitPoint = hitPoint; } // For single chars char GetPlayerChar(void) const { return itsChar; } void SetPlayerChar(char c) { itsChar = c; } // For array of chars const char const * GetPlayerStr(void) const { return itsStr; } void SetPlayerStr(const char *s) { if(itsStr) delete [] itsStr; // If used, free it itsStr = new char[strlen(s) + 1]; // Get new memory strcpy(itsStr, s); } // Copy the string private: int itsHitPoint; // characters Hit Points char itsChar; // Single char char *itsStr; // Pointer to array of chars }; int main(void) { PlayerInfo Player; Player.SetHitPoint(40); Player.SetPlayerChar('A'); Player.SetPlayerStr("Jason Reynolds"); cout << "Hit Points: " << Player.GetHitPoint() << endl; cout << "Player char: " << Player.GetPlayerChar() << endl; cout << "Player name: " << Player.GetPlayerStr() << endl; return 0; } X CMPQwk 1.42 1692 X"As to the adjective: when in doubt, strike it out." --- Maximus/2 3.01 * Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: E3L00014 Date: 03/16/97 From: STEVEN READ Time: 08:38pm \/To: ALEX CLIFFORD HENDERSON (Read 7 times) Subj: Re: compilers?? ACH> =============================================================== ACH> Packet: PC-OHIO ACH> Date: 03-04-97 (15:41) Number: 10394 ACH> From: ALEX CLIFFORD HENDERSON Refer#: NONE ACH> To: PAUL MADDOX Recvd: NO ACH> Subj: RE: COMPILERS?? Conf: (769) C_PLUSPLUS-F ACH> --------------------------------------------------------------- ACH> Yeah, I was a big wattcom fan Alex, How do I search the messages looking for Watcom articles when you spell it as wattcom. Try giving each product proper credit. ACH> (even before I got meself a copy) meself...? ouch. ACH> [....] wattcom, and because I was curious to see how it had There you go again... (redundant grin?) ACH> And now with Rhide, it kicks the arse of wattcom in DOS-32 bit Repeat after me.... Watcom, Watcom, Watcom, .... Right or wrong. At least you're consistant. --- * QMPro 1.53 * steven.read@pcohio.com --- InterEcho 1.19 * Origin: PC-Ohio PCBoard * Cleveland, OH * 216-381-3320 (1:157/200)