--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00003 Date: 01/18/98 From: THOMAS HABETS Time: 02:38pm \/To: LEE BRAIDEN (Read 1 times) Subj: DJGPP LB> probably SET DJGPP="c:\djgpp". NOOOOOOOOOO!!!!!! It's SET DJGPP=C:\DJGPP\DJGPP.ENV --- * Origin: It works? Get out of here! (2:201/293.22) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00004 Date: 01/17/98 From: LEE BRAIDEN Time: 03:49pm \/To: VICTOR KEMP (Read 1 times) Subj: RE:converting char to string Hi Victor, VK> Hi, how do you convert a char to a string? VK> char charvar; VK> char stringvar[90]; VK> strcat(stringvar, charvar); Add a function like: char* chcat(char* str, char ch) { static char tmpstr[2]=" "; /* create a 1-char + NUL string */ tmpstr[0] = ch; /* change the char to ch */ return strcat(str, tmpstr); /* append it to str and return */ } This still uses strcat for all the complicated stuff, and should be almost he same in efficiency terms. Once you've got this done, your example goes like: char charvar; char stringvar[90]; chcat(stringvar, chvar); P.S.: I got this message in the C_PLUSPLUS area... if you're doing it in C++, it's much easier - look up the String class in your manuals. Later, - Lee --- Lee Braiden FIDO: 2:443/777.3 EMail: lee.braiden@coole.piglets.com --- FIPS/32 v0.98 W95/NT [Unreg] * Origin: Oppression is nine tenths of the law (2:443/777.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00005 Date: 01/17/98 From: LEE BRAIDEN Time: 04:09pm \/To: ALL (Read 1 times) Subj: Cygwin32 - easy/high-level window + gadg16:09:4301/17/98 Hi All, I'm using GCC for Win32 (Cygwin32), and don't have a resource compiler (don't like the sound of them anyway) or any high-level GUI libraries. Can someone point me to (on FIDO) a decent library for creating GUI apps for windows (that'll work with CygWin32) ? I know people were talking about a lesstif port - is that available yet? I would settle for EasyWin or V, or anything else you know of (preferably something that produces apps for a few of the main OSes, is free, and which looks reasonably similar to a native application if poss.) Mostly, I just want something fast right now, so I can concentrate on the pp. and forget about the interface... If not, any examples on creating MS-Windows apps without a resource compiler would be great.. Thanks in advance... Later, - Lee --- Lee Braiden FIDO: 2:443/777.3 EMail: lee.braiden@coole.piglets.com --- FIPS/32 v0.98 W95/NT [Unreg] * Origin: Oppression is nine tenths of the law (2:443/777.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00006 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 02:01am \/To: ROBERT HORNE (Read 1 times) Subj: EXE files RH> Can anybody tell me how to tell where the end of an EXE or COM file RH> is? There is no structure at all to a "COM format" DOS executable. It is a raw memory image of the program, starting at offset 0x0100. The other DOS format is the so-called "MZ" format, named after its signature in the first two bytes of the file, which is in turn derived from the initials of a programmer at Microsoft many years ago. The structure of an MZ-format executable is widely documented. Check your nearest files site for one of the many text files on the subject, or pick up any decent DOS programming reference book. Notice that the format of a file is not determined by the file's actual extension. A file with the extension ".COM" can quite legally be in "MZ" format, and a file with the extension ".EXE" can quite legally be in "COM" format. DOS reads the first two bytes of the file and checks for the signature word to distinguish between the two when loading a program. Incidentally, if your executable has been compressed with PKLite, Diet, or whatever, then reading raw data from your executable is possible, but to a large extent completely impractical, because it involves knowing the particular compression algorithm used. Programs that read from and write to their own executables are the reason why the instructions for PKLite, Diet, and others contain so many warnings about "certain programs" that will stop working if they are compressed. The best advice that I can give, therefore, is not to do what you are trying to do. There is, after all, nothing wrong with putting data in a separate data file, rather than embedding it in the executable itself. JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00007 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 12:55am \/To: ALEX WALKER (Read 1 times) Subj: Finding the end of an array? AW> [...] if an array is passed to a function, is there a AW> way to test for or find the end of the array without having the AW> size of the array passed to the function? Simple answer: No. Someone is bound to bring up the subject of the housekeeping information that most C++ compilers maintain for arrays with heap storage duration in response to the above, so I'll reserve the more complicated answer until that time. (-: JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00008 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 12:59am \/To: KURT KUZBA (Read 1 times) Subj: PC speaker DC>> I was wondering if anyone knows of something someone may DC>> have already written that relates pc speaker tones (from DC>> dos.h) to musical notes? KK> Not much call for that, being specific to DOS and Borland. Actually, the PC speaker is specific *to the PC*, not to DOS and Borland C++. One can compile DOS programs to manipulate the PC speaker using compilers other than Borland C++, and PC operating systems such as OS/2 provide system calls such as DosBeep which, being system calls, are independent of the C/C++ compiler -- or even the language -- used. Whilst, regrettably, there is a lot of traffic in this echo generated by newbies that is highly specific to DOS and Borland C++, that isn't the case for *all* newbie questions. JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00009 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 01:13am \/To: CAMERON CLARK (Read 1 times) Subj: Awareness ? JJ>>> class foo { private: JJ>>> static int HowMany ; JJ>>> public: JJ>>> foo() { ++HowMany ; } JJ>>> ~foo() { --HowMany ; } JJ>>> } ; JD>> This scheme doesn't work unless you provide a copy constructor as JD>> well. CC> What about the fact that HowMany is not initialized and can be CC> any number at runtime? That's not the case. If foo::HowMany were not *defined* (as it isn't in the above) then the program would not link. I was generously assuming that foo::HowMany is defined somewhere, since that is just nitpicking. However, even if foo::HowMany were defined without an initialiser static int foo::HowMany ; then it would be zero-initialised. Objects with static storage duration are guaranteed to be statically initialised to zero at program startup in C++. It is only objects with heap storage duration or with automatic storage duration where one has the problem of the "indeterminate value" if one does not use an initialiser. JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00010 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 01:25am \/To: CHRISTOPHER BUTLER (Read 1 times) Subj: Sharing Interrupts under Win95 CB> Does anyone know if its possible, under Win95, to share an CB> interrupt? [...] Bascially, what I want to do, is have one CB> routine in memory, that can be called by programs in other CB> windows Write a DLL. JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00011 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 01:31am \/To: MATT WILLIAMSON (Read 1 times) Subj: convert .bas to .exe MW> I know this is a little off the topic, but I would like to figure out MW> how to convert a QBASIC file, which ends with extension ".bas" to MW> make it an executable file.... Buy a BASIC compiler, and try the BASIC echo. JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1P00012 Date: 01/02/98 From: JONATHAN DE BOYNE POLLARD Time: 01:40am \/To: THOMAS MAEDER (Read 1 times) Subj: What's wrong with this? TM>>> explicit Vector(double xx = 0, double yy = 0); // TM>>> constructor JB>> To kill any compiler warnings, should this not better be written as: JB>> explicit Vector(double xx = 0.0, double yy = 0.0); TM> Implicit conversion from int to double should not produce warnings. There's nothing in the C++ Standard to say that it shouldn't (in fact, there's no concept of "warnings" in the C++ Standard at all), and portability enthusiasts would argue that a good quality implementation *should* produce warnings. After all, it is not guaranteed that values of integral type can be converted to values of floating-point type without loss of precision and silent conversion to the next higher or lower floating-point value that can be represented. JdeBP --- FleetStreet 1.19 NR * Origin: JdeBP's point, using Squish (2:440/4.3)