hi i am a beginner to C
i have encountered a problem with my assignment, and i have researched it on the internet, but unfortunately i didn't find anything related to that.
i am writing a simple program that takes user's input by prompt command, and parse the whole line into an array of strings by spaces between. the part i don't understand is, how to detect the end of the line.
here is my code
int *parameter[10];
int i = 0;
while(!0 && i < 10) {
scanf("%s", ¶meter);
if(!EOF)
break;
printf("parameter is %s\n", ¶meter);
i++;
}
if i type in this in prompt command
word1 word2 word3
here is the program's output
string is word1
string is word2
string is word3
when the program reaches here, it freezes, it cannot seem to detect it is the end of user's input
any help is greatly appreciated.