--------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1V00014 Date: 01/26/98 From: KURT KUZBA Time: 02:52am \/To: ADAM MAJER (Read 1 times) Subj: '/a'=? AM> BW> cout << "The value of /a is " << (char)'/a' << endl; AM> Shouldn't the above give an error? '/a' is more than one AM> char. I think you meant '\a' which is an escape code. He meant '/a', but you are correct. Most compilers in the 16-bit world will give you an error: Too many integers in constant Or something like that. There must be exceptions in either platform or usage, however, since he has used this before. As you have probably found out, it doesn't work well in most circumstances, generating an error. > ] OOPS! I guess they DO fall off the edge of the world........ --- * Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1V00015 Date: 01/23/98 From: BERK OZBOZKURT Time: 01:48pm \/To: BRIAN WOOD (Read 1 times) Subj: '/a'=? Hi Brian Wood, You said : BW> Can someone help me understand why different compilers treat this BW> code differently? Specifically Borland(3.0-4.52) -vs- BW> Microsoft(8.00) BW> cout << "The value of /a is " << (char)'/a' << endl; BW> Borland will send a backslash. Microsoft, the letter a. Borland compilers does not support multi-character, character constants so it just evalutes to first character.. It is perfectly normal that borland sends a backslash.. I don't know the case with microsoft compilers but I guess the difference is related with this multi character thing.. Berk ... I shot the Moderator. I AM the SysOp, didn't shoot myself. --- GoldED/386 2.50.A0715 UNREG * Origin: void BBS where nothing but (2:431/327) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00000 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: JAKE MODUS (Read 1 times) Subj: Re: I need C++ Groovy hepcat Jake Modus jived with All on 22 Dec 97 06:02:46! I need C++'s a cool scene. Dig it! JM> Anybody that has c++ please upload it to this bbs. I really eant to JM> learn c++ but my parents wont purchase it for me. So please upload c++ JM> and if you know any where to get let me know Noone can upload a commercial C++ compiler for you. It's against state, federal and international law to do so. However, there are some freeware, shareware and public domain compilers available for download all over the internet. In particular you should check out DJGPP from ftp.delorie.com for a good free 32 bit C and C++ compiler for DOS. The only other thing I can think of is that you get a cheap old compiler second hand. Wolvaen ... Ever wanted to download pizza? --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00001 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: LEE KIRBY (Read 1 times) Subj: Re: Extra bytes Groovy hepcat Lee Kirby jived with All on 23 Dec 97 16:57:42! Extra bytes's a cool scene. Dig it! LK> I'm very new to C++, and can't figure out why I get two extra bytes LK> when I write this structure to a file: Structures can be "padded" with extra bytes for allignment purposes. When you define a structure, there's no guarantee that the compiler will "pack" it, ie. cause all members to be contiguous within the structure. Some data types are more efficient if alligned to word or double word boundaries. This depends on both the platform and the data type. Wolvaen ... All reality is aspect dependent. --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00002 Date: 01/24/98 From: PETER HAYWOOD Time: 01:43am \/To: BOGDAN SHEPTUNOV (Read 1 times) Subj: Re: how should I return pointer to strin01:43:3201/24/98 Groovy hepcat Bogdan Sheptunov jived with All on 21 Dec 97 05:43:08! how should I return pointer to string?'s a cool scene. Dig it! BS> char* BS> IniFile::readLine(void) BS> { BS> char buffer[NAME_MAX_LENGTH]; BS> char *_value; ... BS> return _value; BS> } BS> A problem is here: in readline(void) _value is OK. I mean it points to BS> the correct line. But when "return" is called "buffer" is being BS> destructed, and the result of the call Of course that's what happens. buffer is automatic. There are several ways to go here. You could declare buffer static (probably the simplest way). You could allocate memory for the array dynamically (and have the calling function free/delete it - not recomended). Or, the one I would recomend, you could allocate an array before the call, either statically or dynamically, and pass a pointer to that - or even a reference - to IniFile::readLine(). Perhaps another good idea, make buffer a class member instead of just a datum inside a function. Wolvaen ... Since I've used up all my sick time, I'm calling in dead, Jim. --- Blue Wave/RA v2.20 * Origin: The Gate, Melbourne Australia, +61-3-9809-5097 33.6k (3:633/159) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00003 Date: 01/17/98 From: VADIM MIHAILOV Time: 11:17am \/To: VICTOR KEMP (Read 1 times) Subj: converting char to string , Victor! -- | 뫮 ( ) p 13 1998 20:05, ᠫ Victor Kemp :All: VK> I would like to concatenate a single char onto the end of a string but VK> it says it can't convert int to char * when I do this: VK> char charvar; VK> char stringvar[90]; VK> strcat(stringvar, charvar); VK> I also tried doing: VK> strcat(stringvar, (char *)charvar); VK> but that made a big mess of things although gave no error message. May be: char charvar; char str[100]; char temp[2]=" "); temp[0]=charval; strcat(str,temp); Or if you now length of the string: char str[100]="RTFM"; char charval; str[4]=charval; str[5]=0; : ᥣ. Vadim | ------ --- GoldED/386 2.50+ * Origin: 筮 , ᫨誮 (2:5025/88.9) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00004 Date: 01/16/98 From: BOGDAN SHEPTUNOV Time: 10:28pm \/To: VICTOR KEMP (Read 1 times) Subj: Re: converting char to string Hello Victor. 13 Jan 98 20:05, Victor Kemp wrote to All: VK> Hi, how do you convert a char to a string? VK> I would like to concatenate a single char onto the end of a string but t VK> says it can't convert int to char * when I do this: VK> char charvar; VK> char stringvar[90]; VK> strcat(stringvar, charvar); You may use sprintf. Something like this: sprintf(stringvar, "%s%c, stringvar, &charvar); VK> I also tried doing: VK> strcat(stringvar, (char *)charvar); VK> but that made a big mess of things although gave no error message. Ofcourse. Char is not null-terminated. Bogdan --- * Origin: Crematory (2:463/285.82) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00005 Date: 01/16/98 From: BOGDAN SHEPTUNOV Time: 10:32pm \/To: MICHAEL RATHBURN (Read 1 times) Subj: Re: sort algorithm Hello Michael. 12 Jan 98 18:41, Michael Rathburn wrote to All: MR> @TAGID: Tag-O-Matic V.13 Eval 619 MR> Hi All , hope you are having a nice day MR> Can someone explain how this sort works I have tried to follow it but I MR> just get confused. It's a usual algorythm. In fact it's not used often because it's a bit slow. :) The main point of it is that we shall find a place for every item of the array. To do this we should compare every item with others and find place for it. Bogdan --- ਬ筠 ᯨࠫ ஬ 3.00.Alpha5+ * Origin: Crematory (2:463/285.82) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00006 Date: 01/16/98 From: BOGDAN SHEPTUNOV Time: 10:36pm \/To: ALL (Read 1 times) Subj: UNIX programming Hello All. I'm looking for UNIX programming echo. I'm especially interested in C++ UNIX programming. Could anybody tell me does such echo's exists? Bogdan --- ਬ筠 ᯨࠫ ஬ 3.00.Alpha5+ * Origin: Crematory (2:463/285.82) --------------- FIDO MESSAGE AREA==> TOPIC: 203 C++ Ref: F1W00007 Date: 01/20/98 From: ALEX ZAVALIN Time: 03:40am \/To: GERRY DANEN (Read 1 times) Subj: sending AT commands You're welcome, Gerry ! 07 98 20:32, Gerry Danen -> Darin McBride: DM>> Depends on your OS. For example, under Linux, OS/2, and likely DM>> Win32, fopen would work. Under DOS, however, you need to either DM>> get a com port library, learn how to use a FOSSIL, or learn how DM>> to deal with the serial port on a low level (via DM>> outportb/inportb). GD> Not so. The following works just fine under DOS: GD> void offhook( void ) GD> { GD> FILE *port ; GD> port = fopen( "COM1", "w" ); GD> fprintf( port, "ATM0H1\n" ); GD> fclose( port ); GD> } And how can I get responses ? Sincerely yours, Aleksey --- BUG TERMINATOR model 3.00.Alpha5+ * Origin: ᫨ 祭 , (2:467/66.33)