Urk, I had missed the use of gets()
in the original, or I would have mentioned it... using gets()
, under any circumstances, is a serious problem, as it doesn't check to make sure that the input will fit into the buffer it reads into. Using gets() is just asking for buffer overruns; in C++, you should use cin.getline()
instead.
void getopts()
{
for (int i = 0; i < 4; i++)
{
cin.getline(option[i], 20);
}
}
BTW, your indentation style is, to be blunt, atrocious. Please be more careful about indentation, or else use an auto-formatter (VC++ 6.0 includes one, IIRC).