Hello Victor.
13 Jan 98 20:05, Victor Kemp wrote to All:
VK> Hi, how do you convert a char to a string?
VK> I would like to concatenate a single char onto the end of a string but
t
VK> says it can't convert int to char * when I do this:
VK> char charvar;
VK> char stringvar[90];
VK> strcat(stringvar, charvar);
You may use sprintf. Something like this:
sprintf(stringvar,
"%s%c,
stringvar,
&charvar);
VK> I also tried doing:
VK> strcat(stringvar, (char *)charvar);
VK> but that made a big mess of things although gave no error message.
Ofcourse. Char is not null-terminated.
Bogdan
---
---------------
* Origin: Crematory (2:463/285.82)
|