Hi,
I'm expecting a very long input like up to 1000 values each as big as 1to100 (1 55 100 34 44 etc.). This is how I do it:Is there any nicer way of doing it. I'm just not used to deal with input from external world as I'm an embedded system programmer.Code:char buffer[4 * 1000]; char *ptr; char val; int i; scanf("%s", buffer); ptr = buffer; for (i = 0; i < 1000; i++) { sprintf(val, "%d ", ptr); // update ptr and process val. }
Thanks for any advice.