I am trying to enter a string (or a number of integers) from the command line using Objective C. These numbers are separated by a space.
Sample Input: 1 2 3 4 5
I am trying the code
char input[100] = {0};
NSString *inputString;
scanf("%s", input);
inputString = [NSString stringWithCString:input encoding:NSUTF8StringEncoding];
The resulting value of inputString
is 1.
How do I get the entire value into the string ?