Say char ch[10]; but make sure the array is big enough.
Also, you can't do this either
strcat( str, ch ); str is a string constant (it may be in read-only memory). Modifying it will kill your program.
Use say
char str[100] = "a string";
Last edited by Salem; Sep 6th, 2008 at 3:44 pm. Reason: more code mistakes spotted
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Offline 7,164 posts
since Dec 2005