[Courses] [C] question about concatenating ints to strings (simple question)

Morgon Kanter admin at surgo.net
Fri Dec 6 20:27:02 EST 2002


how would I cast an integer value to a character before passing it to 
stringcat? For example:

int a = 1;
char current_number[5];

strcat(current_number, (char *)a); <---- this line gives SIGSEGV (segfault)

(char) and no cast also sends segfault...how do I fix this problem :P It's 
been plaguing me since I started this (exercise 3 lesson 13)

Morgon
--
grab my updated (11/25/02) public key from http://www.surgo.net/pubkey.asc




More information about the Courses mailing list