I can't remember how to do "if" conditional structures.
There's a tiny little part of the program, where it'll ask you a "Yes or No" question. Basically I want it to go like this: if answered yes, it continues to the next section, if answered no then program closes (return 0;).
I'm just asking to see if anyone here knows off hand. If not I'll do more web surfing.
TIA -reeg
C++ Help
- Dog
- Server Ops
- Posts: 14317
- Joined: Sun Oct 15, 2006 12:12 am
- Location: In the bath, having a good think....
-
Games Played
Ville Awards
-
Loading…
Re: C++ Help
You mean something like this:....?
Code: Select all
int main()
{
char ans='n';
while( dir != '\r' )
{
cout << "\nIs Regis cool? (y/n): ";
ans = getche();
switch(ans)
{
case 'y': callroutine(); break;
case 'n': return 0; break;
}
}
return 0;
}
Who is online
Users browsing this forum: No registered users and 4 guests