TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ROGER SCUDDER
from: AUKE REITSMA
date: 1998-01-21 20:03:00
subject: char to string

Hi Roger,
On 20 Jan 98, 14:16, you wrote to Eric Londaits
 EL>> strcat takes *char as parameters... so try
 EL>> strcat(stringvar, &charvar);
 EL>> (&charvar should be the memory address of charvar, just like
 EL>> stringvar is the memory address that points to *stringvar)
 RS>  That's the first time I ever say anybody do that.
 RS>  Very nice solution!  I can't understand why I never see
 RS>  anyone using it.
It is NOT NICE !!!
I agree that &charvar does point to the 'proper' character, but there's no
guarantee at all that the subsequent character is a string-terminating ascii 
nul. Yes, if it does work it'll might work always for that particular case. 
But in the next case it might start a low level format of your HD ...
(On my old XT I could do that anyway ;-))
Greetings from
 _____
 /_|__|  Auke Reitsma, Delft, The Netherlands.
/  | \  --------------------------------------
--- GEcho 1.00
---------------
* Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20)

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