|
-
Aug 5th, 2000, 09:42 AM
#1
Thread Starter
Frenzied Member
I've been doing too much basic. I can only remember the Basic syntax for Select Case. What is the right way in C++?
I need better memorizational skills
-
Aug 5th, 2000, 10:26 AM
#2
Try the switch statement.
Code:
int nAge;
cout << "Enter your Age";
cin >> nAge;
switch( nAge )
{
case 20:
cout << "Your are the same age as me";
break;
case 90:
cout << "You are older than my grandpa";
break;
case 50:
cout << "You are about the same as my parents";
break;
}
-
Aug 5th, 2000, 10:55 AM
#3
Monday Morning Lunatic
Use case default: for anything that doesn't fit the others.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 6th, 2000, 12:13 PM
#4
Thread Starter
Frenzied Member
Perfect. Thanks guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|