I am a novice with respect to C programming. This is my first semester in college that I've taken a C class. I apologize if my question is a bit rudimentary.

The program I'm working on is an assignment that reads a text file and compares a word bank of strings to text messages to check for misspelled words and such. The first line in the input file is n numbers of words in the "dictionary" (the proper words which are used for comparison). The next n lines are the words contained in the dictionary.

I'm having trouble reading these strings into a 2-dimensional array with n rows and 30 columns (the words cannot be more than 29 characters + 1 null character). Here's what I have:

Code:
int main() {
    FILE *textMsg; // Text input file pointer
    int n, m, t, w; // Asignment variables from in-text values
    int i, j, k; // Counter variables
    char c;

    if((textMsg = fopen("textmsg.txt", "r")) == NULL ){
        printf("Sorry, the file could not be opened.\n\n");
        system("PAUSE");
        return 0;
    }
    
    fscanf(textMsg, "%d", &n); // Get number of words in the dictionary

    char dictionary[n][30]; // Declares the array to store the dictionary words

    while(!feof(textMsg)){
        for(i = 0; i <= n; ++i){
            for(j = 0; j <= 30; ++j){
                fgets(*dictionary, j, textMsg);
            } 
        } 
    } 

    fclose(textMsg);

    system("PAUSE");

    return 0;
}
I have obviously included the string.h header. I was using the fgets() function to read each line until the new line character, hoping that it would only store that many characters and then move onto the next interation in the loop, but its reading the entire file, not n lines of text and <30 characters per line. The dictionary words are only a small chunk of the entire file so there will be multiple arrays in the final product which is why I'm not interested in reading the entire file.