TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: VICTOR KEMP
from: BRIAN WOOD
date: 1998-01-15 16:27:00
subject: converting char to string

-=> Quoting Brian Wood to Victor Kemp <=-
 BW> Maybe this would work, but there are probaly several right answers.
 BW> 
 BW> int t=strlen(stringvar);
 BW>    if(t       stringvar[t]=charvar;    /* put charvar on the end */
 BW>       stringvar[t+1]='\0';     /* keep it a string! */
 BW>    }
 BW> else
 BW>    /* some error message, stringvar is full! */
Actually, I think that could overwrite stringvar too, since we're going
to add 2 characters to the end of it, accounting for the null.
Probably best to use
   if(t * Origin: River Canyon Rd. BBS  Chattanooga, Tn (1:362/627)

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