Groovy hepcat Sona was jivin' on Wed, 10 Sep 2003 06:44:29 +1000 in
comp.lang.c.
Char to char*?'s a cool scene! Dig it!
How is it possible to convert a char to char* in C? I'm trying to append
Don't. There's a better way.
a char to the end of a char* using the strcat function.. the following
Try this:
char *charcat(char *s, char c)
{
size_t len = strlen(s);
s[len] = c;
s[len + 1] = '\0';
return s;
}
--
Dig the even newer still, yet more improved, sig!
http://alphalink.com.au/~phaywood/
"Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
I know it's not "technically correct" English; but since when was rock & roll "technically correct"?