TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: VICTOR KEMP
from: TIM HUTZLER
date: 1998-01-16 16:44:00
subject: Re: char to string

-=>Quoting Victor Kemp to All <=-
VK>Hi, maybe that last char to char * question I asked in this
VK>echo was so simple that no-body bothered to reply.
VK>Anyway I need to append a char onto the end of a string, something
VK>like this
VK>char stringvar[90];
VK>char charvar;
VK>strcat(stringvar, charvar);
VK>But that doesn't work, someone please tell me how it's done.
charvar *must* be a string, ie. it must be termintaed with a NULL.
char stringvar[90];
char charvar[2] = "";
//store the char to append to charvar[0] then call strcat
strcat(stringvar, charvar);
Hope that helps...
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88)

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