Code:
 for(i=0; i<n; i++)
        if ( strcmp ( a[i].word, search_word ) == 0 ) {   // (1)

            cout << "- - - - - - - - - -" << endl;
            cout << a[i].word << ", " << a[i].word_pl << "(pl)" << " - " << a[i].word2 << endl;

        }


        else if ( strcmp (a[i].word1_pl, search_word ) == 0 ){  // (2)

            cout << "- - - - - - - - - -" << endl;
            cout << a[i].word_pl << ", " << a[i].word<< "(sg)" << " - " << a[i].word2 << endl;

            }




        // " did you mean ?" search

        else if ( strncmp ( a[i].word1, search_word, 2) == 0){  // (3)
                cout << a[i].word1 << endl;


        }
it's part of a function that's supposed to do a word search in a binary file.
the first if searches for the singular form of the word. if it doesn't find it goes to second if searches for plural form. again, if it doesn't find it goes to the third if the didyoumean search type. all good.

the problem is that if the first if works it still does the third if . same goes for the second if.

for the first and second if the output should only be the word's translation but i also get the some other words coresponding to the third if.

any ideas?

thanks