As someone told me before, you can't compare strings with '=='. You have to use strcmp (part of <cstring>) or compare (part of <string>... maybe that'S the issue... also, don't forget to use
1 2
cin.sync();
cin.clear();
before using getline(), as something could remain in the stream buffer of cin or something like that, mostly if you've used cin >> before in the same code.
As someone told me before, you can't compare strings with '=='.
You can't compare a C-style string with a C-style string using == (doing so compares the address of one C-style string to another.) You can however compare a std::string with a std::string or a std::string with a C style string using ==
The problem with the OP's code is that he had a two dimensional array of strings, when he needed a one dimensional array of strings, and that he was accessing outside of the bounds of that array.