Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c convert int to string

int numToConvert = *your number*;

 // calculate the length of the resulting string
int ENOUGH = malloc(sizeof(char)*(int)log10(numToConvert));
char str[ENOUGH];

sprintf(str, "%d", 42);

// str contains the number in string form
Source by stackhttps #
 
PREVIOUS NEXT
Tagged: #convert #int #string
ADD COMMENT
Topic
Name
9+8 =