Q:

objective c convert 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;

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

Tags

New to Communities?

Join the community