You have multiple logic errors.
1. You can't compare character array strings like that, because character arrays are character pointers, and so you're comparing two memory addresses instead of two sets of memory. Try using std::string so you can do MyStringA == "Hello!" and the likes.
http://www.cplusplus.com/reference/string/string/
2. Doing if(a == b || c) doesn't do what you think it does. In C++, this means "if the expression 'a == b' is true OR if the expression 'c' is true"; anything that is 'not zero' is considered true, so if c is not 0, then the if statement is true. To fix, do: if(a == b || a == c)
3. Array indexes start at zero, not one. So an array of 5 elements has indexes zero to four. This means that an index of five, like you have just about everywhere in your program, is going to be random other memory that probably won't want to be changed or accessed.
4. Never call main()! Just don't! Instead, using a looping structure like do-while to repeat your program at the user's request.
5. MenuOption should be an int, not a character array.
6. Fix these problems and repost your code again if you have problems, but make sure you put it in code tags like this:
[co
de]
int main()
{
cout << "Hello, world!" << endl;
}
[/code]
and it turns into this:
1 2 3 4
|
int main()
{
cout << "Hello, world!" << endl;
}
|