I'm writing a program that takes in single words from a user. The goal is for the program to take in ONLY a single word (i.e. if there is space in the user's input, it will trigger an error).

I've read a lot of things about the pros and cons of the different input methods (scanf, gets, fgets, etc), and think I want to avoid gets.

Currently I'm working with:

Code:
    gettimeofday(&start, NULL);
    for (int i = 0; i < n; ++i){
        do{
            printf("Word number %d: %s\n>", i+1, arr[i]);
            scanf("%10s", word);
            scanf("%*[^\n]"); scanf("%*c");
      
            if(strcmp(arr[i], word) != 0){
                printf("Incorrect.\n");
                correct = 0;
            }

            else{
                correct = 1;
            }
        } while (correct == 0);
    }
    gettimeofday(&stop, NULL);





This works, but counts for example "word word" as just "word" (by scanf stopping at whitespace).

Does anyone have any recommendations or advice about how to go about accomplishing what I'm trying to do?

Or suggestions on the scanf/fgets debate?