I'm trying to get numbers from stdin to an array. the first number in stdin is the number of elements in the array (the number can be any int). I did this to get the first number:
while(c=getchar()!=' '){
n*=10;
n+=atoi(c);
}
And then created an array of size n. Now I need to go through all the rest
while(c=getchar()!=EOF)
and add numbers to the array. The numbers are separated by \t and sometimes \n as well. How would I do that? I've been thinking for an hour and still haven't got a working code. Any help? Thanks!