TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: VICTOR KEMP
from: ALEXEY MOKHOV
date: 1998-01-17 18:08:00
subject: converting char to string

Hello, Victor!
13 Jan 98, Victor Kemp wrote to All:
 :VK>            char charvar;
 :VK>            char stringvar[90];
 :VK>            strcat(stringvar, charvar);
Both parameters of strcat-function should be c-strings(with '\0' at the end). 
These '\0' are using for indication of start and finish concatination. So you 
can not use strcat. Try
           strncat(stringvar, &charvar, 1);
Probably it will work.
 :VK>            strcat(stringvar, (char *)charvar);
What is (char *)charvar? Char (contents) is converting into pointer to char. 
What will address this pointer?
Alexey
--- GoldED 3.00.Alpha4+
---------------
* Origin: St_1, St.Petersburg Russia (2:5030/155.19)

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