Convert Int Into String C Code Example


Example 1: c int to string


#include <stdio.h>

int main()
{

char number_str[10];
int number = 25;

sprintf(number_str, "%d", number);
printf("Converted to string : %s\n", number_str);

return 0;

}

Example 2: objective c convert int to string


NSString* myNewString = [NSString stringWithFormat:@"%d", myInt];

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable