If-Else statements is kinda like in algebra;
if it's black, it's an 8 ball. Else (it's something else)...
1 2 3 4 5 6 7 8
|
if (black)
{
cout << "it's an 8 ball" << endl;
}
else
(
cout << "It's not an eight ball" << endl;
)
|
I know it's a stupid example, but that's kinda the gist of it, I think.
You could do what you're trying to do with IF-Else Statements, but why complicate life?
And "cin.ignore (99)" let's the person hit ANY key for 99 times before the console closes. (the 99 is modifiable bytheway; I use 99 kind of like standard)
My teacher told me to use it everytime you use "cin" and at the end of course.
Otherwise, you might have problems with your console closing down. Ever since I use it I don't have that problem anymore.
:3
yes, I asked my instructor that. I feel like I waste his time cause he has a PhD and I'm here like "oh, what's this for?" all the time. :3