--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00023 Date: 09/13/97 From: JAVIER KOHEN Time: 10:22am \/To: FRANK MASINGILL (Read 2 times) Subj: Mathplay.Cpp 10:22:4709/13/97 On 24-Aug-97, Frank Masingill wrote to Cliff Rhodes about Mathplay.Cpp [1]. FM> The OOP program examples one sees in the books I have (and I have FM> a few) seem to avoid not only placing color in the programs and FM> menus but even avoid discussing it. As I go further, I'm sure That's because text coloring isn't part of the language, but an compiler's library extension. You are free to use and abuse of it, while you don't need portable code, or you were using a portable library (I once saw one that claimed to replace Borland's constream in an InfoMagic Linux distrii, I could E-Mail it to anybody, I haven't checked it out, though). Javier Kohen [The_Crusher] http://jkohen.base.org ... Se come cada boludeces! Boludo comilon -!- CrusherTag 0.3.2. --- Terminate 5.00/Pro * Origin: The King of The Ring (4:900/748.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00024 Date: 09/13/97 From: JAVIER KOHEN Time: 10:27am \/To: MATTHEW DUHART (Read 2 times) Subj: Re: A password program I On 25-Aug-97, MATTHEW DUHART wrote to CAMERON CLARKB@ about Re: A password program I. return password.right(pass) ? 1 : 0; MD> I'm just a beginner, so how do you give password in password.right MD> a value? And one other thing, how can the password be text and/or MD> numbers? a) See above. b) Let it be alphanumeric, ie: (char *) or some string class. Javier Kohen [The_Crusher] http://jkohen.base.org ... f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng -!- CrusherTag 0.3.2. --- Terminate 5.00/Pro * Origin: ASS - Anti Stones Squad - ASS Simply Sucks (4:900/748.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00025 Date: 09/13/97 From: JAVIER KOHEN Time: 10:38am \/To: ERIK WARMELINK (Read 2 times) Subj: converting sound data On 26-Aug-97, Erik Warmelink wrote to Mathieu Bouchard about converting sound data. MB>>> i'd rather do: x=(x+128)/256 EW> Thinking about it (I knew I had forgotten something ;-)), it is EW> also dangerous for signed values. 32767 + 128 == -32641, resulting EW> in -127, not really close to 127.99609375. OTOH using 32bit I have no idea why you are adding 128 to x before dividing, but I have some knowledge of maths and quickly figured out (as you probably did) that it could be replaced with "x = x / 256 + 128 / 256" avoiding 16-bit integer overflow. Javier Kohen [The_Crusher] http://jkohen.base.org ... You Don't Want Money, You Don't Want a Diamond Ring, You Say You Want My Lovin' More Than Any Other Thing Ramones -!- CrusherTag 0.3.2. --- Terminate 5.00/Pro * Origin: ASS - Anti Stones Squad - ASS Simply Sucks (4:900/748.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00026 Date: 09/13/97 From: JAVIER KOHEN Time: 10:42am \/To: KEVIN CAMPBELL (Read 2 times) Subj: DOS Window On 23-Aug-97, Kevin Campbell wrote to Christopher Butler about DOS Window. KC> Why not write your own routine. Text memory begins at KC> 0xB800:0x0000. Simply make a pointer to that memory and alter it. While in color modes... mono modes use 0xB000:0x0000, you should take care of it. Javier Kohen [The_Crusher] http://jkohen.base.org ... Yo no quiero una hippie nerviosa, yo no busco una punk fatal... uperuva -!- CrusherTag 0.3.2. --- Terminate 5.00/Pro * Origin: ASS - Anti Stones Squad - ASS Simply Sucks (4:900/748.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00027 Date: 09/13/97 From: JAVIER KOHEN Time: 10:45am \/To: COYOTE (Read 2 times) Subj: DJGPP with C++ add-on On 26-Aug-97, Coyote wrote to All about DJGPP with C++ add-on. C> #include "car.hpp" //CAR.HPP IS IN THE SAME DIRECTORY C> void car::initialize(int in_wheels, float in_weight, int people) { C> passenger_load = people; vehicle::initialize(in_wheels, in_weight); C> } C> int car::passengers(void) { return passenger_load; } Your program lacks of a main() function, so it can not be compiled as an executable, maybe the command line is wrong. Also, your class doesn't seem to be actually defining a vehicle object, or you had a type where you call vehicle::initialize(). Javier Kohen [The_Crusher] http://jkohen.base.org ... EchoMail (ek-o-mael) n. A tagline distribution system -!- CrusherTag 0.3.2. --- Terminate 5.00/Pro * Origin: The King of The Ring (4:900/748.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00028 Date: 09/14/97 From: BALOG PAL Time: 10:28pm \/To: ROGER SCUDDER (Read 2 times) Subj: Signs of numbers Hi, Roger Scudder! On 12 Sep 97 00:12:00 you wrote to Jerry Coffin JC> if an inline function will work, it's better than a macro. It JC> will generally eliminate the same function call overhead that a JC> macro is usually intended to eliminate. Later, Jerry. RS> But inline is only a request. YEs, that is really a hint to the compiler. But in practice I saw the compiler will take it unless you override it yourself with other settings given (explicit request to outline all functions in debug build, size limitation settings for inline functions and so on.) RS> The compiler does not have to RS> place the code inline. I think an any good compiler will not ignore the request without a strong reason. RS> Would the same apply to a macro? Definitely no. But does it really worth it? You can easily introduce strange, hard to find bugs. Where using inline functions give you and the compiler opportunity to catch them at compile time. Paul ... I don't see you, so don't pretend to be there --- OS/2 Warp * Origin: The FlintStones' Cave in BedRock (2:371/20) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00029 Date: 09/14/97 From: BALOG PAL Time: 10:28pm \/To: ROGER SCUDDER (Read 2 times) Subj: Worked this out Hi, Roger Scudder! On 12 Sep 97 15:25:00 you wrote to Kurt Kuzba KK> class MathCalc KK> { KK> private: KK> int iVar1, iVar2, iResult; RS> Why do you code the private keyword when the data is private RS> by default. Is this considered good style? I don't know what is considered, but I generally code that too. It's more intuitive to me reading back the code, and make the maintainance easier too. Somtime you have to move the data members between public/prot/priv sections, or reorder the sections themselves. If you later find more convenient to see those vars above at the bottom of the class deffinitions, you imply select and move it. If you omitted the private: you will have to type it in later. If you have several comment lines at the beginning of the class (and sure you have them, that is not that simple to keep in mind, some variables you see are private just 'cos they are at the beginning. A fat class will commonly have a dozen of such labels, so why omit that one at the very start. Paul ... Gentlemen: Start your debuggers... --- OS/2 Warp * Origin: The FlintStones' Cave in BedRock (2:371/20) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00030 Date: 09/15/97 From: ROGER SCUDDER Time: 08:27am \/To: KURT KUZBA (Read 2 times) Subj: Worked this out Hi KURT, KURT KUZBA was observed on 14-Sep-97, writing to ROGER SCUDDER Something about: Worked this out RS>> KK> class MathCalc RS>> KK> { RS>> KK> private: RS>> KK> int iVar1, iVar2, iResult; RS>> Why do you code the private keyword when the data is RS>> private by default. Is this considered good style? KK> I don't know, really. It's just something I picked up. KK> I always put the public functions at the top of the class KK> and then put in the private members later, which means I KK> have to specify that they are private. But in this case you didn't place public data at the top. You did exactly what is above, which is place private members at the top. My question is, if the data is private and it is at the top, before any access specifiers, why would you place a private tag before it, when the access is already private by default? I am not singling you out. I have seen several other people do that. Really it's not that important to me to know why you did it. I think the important thing is that one knows the difference. Roger Scudder rogers@gim.net ... 'If it ain't broke, you can probably still fix it.' - Tim Allen --- Terminate 5.00/Pro * TerMail/QWK * Terminate = Pointmailer+Tosser+Reader+Packer+QWK! --- WILDMAIL!/WC v4.12 * Origin: FIDONET * Remote Control BBS * 610-623-5273 * (1:273/420.0) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00031 Date: 09/15/97 From: GERRY DANEN Time: 09:06pm \/To: ROGER SCUDDER (Read 2 times) Subj: New to C RS>> There are both C and C++ tutorials available from Coronado RS>> Enterprises. You can find them at better Bulletin Boards and ftp RS>> sites. GD> Do you have some addresses? RS> No Problimo' RS> point your ftp client to: oak.oakland.edu [snip] Thanks! :) Gerry Danen (gdanen@accessweb.com) C+Net BBS @ 403-477-9545 http://www.geocities.com/SiliconValley/Way/9823 2 years, 107 days, 2 hours, 53 minutes, and 59 seconds until January 1, 2000. --- Maximus 3.01 * Origin: C+Net BBS. Programming & Networking. (1:342/1017) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: EDM00032 Date: 09/15/97 From: JERRY COFFIN Time: 10:38pm \/To: FERNANDO ARIEL GONT (Read 2 times) Subj: MID$ On (06 Sep 97) Fernando Ariel Gont wrote to All... FA> Is there any MID$ BASIC-like function in C or C++? FA> (I'm using TC and TC++ (both by Borland, of course).... Not exactly. However, there are generally ways of accomplishing what you want without it, often more quickly and easily. Depending on what version of TC++ you've got, it may have a string class that includes a function with similar functionality. However, my experience personally is that it's rarely of much use. Later, Jerry. --- PPoint 2.02 * Origin: Point Pointedly Pointless (1:128/166.5)