how I can make my program read a text file and compare the words from the text file with the words that I defined in an array and print a message. I think the main problem is the for loop cause i'm not sure if it iterates correctly.Here is my code:
define MAX_SIZE 1000
int main()
{
    FILE * yourfile;
    char  as_array[MAX_SIZE];
    char name[20];
    const char * keywords[]={"if", "else", "return", "switch", "case", "default", "for", "do", "while", 
                             "break", "continue", "struct", "typedef", "union", "enum", "sizeof", "int", "float", "double", 
                             "void", 
                             "extern",
                             "signed", "unsigned", "long", "short", "static", "const",  "goto", "auto", "register", "volatile"};
    printf("Please write the file you want to open: \n ");
    scanf("%s", name);
    int number_of_keywords = sizeof(keywords)/sizeof(keywords[0]);
    //fopen opens the file; exits with error if the file cannot be opened
    if ((yourfile = fopen(name, "r"))== NULL){
        printf("Could not open file: %s", name);
        exit(1);
    }
    else printf("Your file has been successfully opened!\n");
    while(!feof(yourfile)){
        fgets(as_array, MAX_SIZE, yourfile);
        printf("%s\n", as_array);
        char x = gets(as_array);
        for(int i = 0 ; i<number_of_keywords; ++i){
            if(keywords[i]== x){
                printf("I found word %s\n", keywords[i]);
            }
        }
        return 0;
    }
}
 
     
    