-=>Quoting Victor Kemp 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
VK>string but it says it can't convert int to char * when I do
VK>this:
VK>char charvar;
VK>char stringvar[90];
VK>strcat(stringvar, charvar);
"charvar" must be a string, ie. a char array. It must be terminated
with NULL.
VK>I also tried doing:
VK>strcat(stringvar, (char *)charvar);
VK>but that made a big mess of things although gave no error message.
It will concat all characters until a NULL comes up.
I noticed a little routine in the SNIPPITS library: Look up a file
under the name "strchcat." It's not the way I would approach it, but
none-the-less instructive.
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 530-893-8079 * (1:119/88)
|