scanf with strings... please help

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", &parameter);
           if(!EOF) 
           break;
           printf("parameter is %s\n", &parameter);
           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. :slight_smile:

From our rules:
(6) Do not post classroom or homework problems.

But I'll give a few hints before I close this thread.

EOF is a constant, often set to -1. Your "if(!EOF)" is waiting for -1 to become 0. You might check the return code from scanf to see it that is EOF. (But then your program is checking for when the user types cntl-D.)