View previous topic :: View next topic |
Author |
Message |
johny Guest
|
Append char to string |
Posted: Thu Jun 10, 2004 12:54 pm |
|
|
Hi,
How to append character to the string?
Thanks,
Johny |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Thu Jun 10, 2004 1:33 pm |
|
|
Where str is the string, and char is the char you want to append:
sprintf(&str[strlen(str)],"%c",char); |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Thu Jun 10, 2004 1:39 pm |
|
|
Try using the strcat() function. |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Thu Jun 10, 2004 2:09 pm |
|
|
oh yeah, forgot about that one. |
|
|
|