Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c convert integer 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 #integer #string
ADD COMMENT
Topic
Name
2+9 =