TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ROGER SCUDDER
from: FRANK SCHMID
date: 1998-01-22 00:56:00
subject: Re: char to string

Hi Roger,
VK>>> char stringvar[90];
VK>>> char charvar;
VK>>> strcat(stringvar, charvar);
EL>> strcat takes *char as parameters... so try
EL>> strcat(stringvar, &charvar);
>  Very nice solution!  I can't understand why I never see
>  anyone using it.
Because it doesn't work !
strcat copies the string beginning at the address of charvar until it  
discovers a NUL-character, but where would it be... some 1 or 2 characters  
away or even 1k or more ?????
if you use strcat you MUST use a NUL-terminated string.
bye
Frank
--- XPoint
---------------
* Origin: VGA-Planets, was sonst ... (2:245/6837.11)

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