TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: VICTOR KEMP
from: NEIL HELLER
date: 1998-01-17 09:32:00
subject: CHAR TO STRING

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.
Your example is C, not C++.  The C++ way to do it is to overload the
"=" operator for whatever type you'll be appending (in this case a
character).  The C answer to your question is that strcat expects to
receive 2 pointers to char; you're only sending it one (plus a char).
--- FLAME v1.1
---------------
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)

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