|
-
Jan 6th, 2002, 06:11 PM
#1
Thread Starter
Frenzied Member
why skipping?
Code:
cout<<"Enter A Menu Option: ";
cin>>menuOpt;
while(menuOpt>4 || menuOpt<1)
{
cout<<"Please Enter A Valid Input (1-4): ";
cin>>menuOpt;
}
switch(menuOpt) //Main game switch statement
{
case 1:
cout<<"1 chosen"<<endl;
break;
case 2:
cout<<"2 chosen"<<endl;
break;
case 3:
cout<<"3 Chosen"<<endl;
ShowAbout();
break;
case 4:
cout<<"GoodBye!"<<endl;
return 0;
break;
}
why does it skip over case 1 - 3? only case 4 works....why?
-
Jan 6th, 2002, 06:42 PM
#2
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 6th, 2002, 06:52 PM
#3
Lively Member
seems ok to me too... dropped it into my vc++ as a console app with some necessary syntax... and it worked...
#include <iostream>
using namespace std;
int main(void)
{
int menuOpt;
cout<<"Enter A Menu Option: ";
cin>>menuOpt;
while(menuOpt>4 || menuOpt<1)
{
cout<<"Please Enter A Valid Input (1-4): ";
cin>>menuOpt;
}
switch(menuOpt) //Main game switch statement
{
case 1:
cout<<"1 chosen"<<endl;
break;
case 2:
cout<<"2 chosen"<<endl;
break;
case 3:
cout<<"3 Chosen"<<endl;
break;
case 4:
cout<<"GoodBye!"<<endl;
return 0;
break;
}
}
-
Jan 6th, 2002, 07:31 PM
#4
Thread Starter
Frenzied Member
my VC++ gets very picky sometimes thanks
-
Jan 6th, 2002, 07:34 PM
#5
Thread Starter
Frenzied Member
I've restarted VC++ and deleted the original exe so it could fully recompile it...still doesn't work
attached file uses apstring.h and .cpp
-
Jan 6th, 2002, 07:39 PM
#6
Thread Starter
Frenzied Member
it apears only to be linking....how can I fix it so it compiles also
-
Jan 6th, 2002, 08:20 PM
#7
Hyperactive Member
Originally posted by SteveCRM
it apears only to be linking....how can I fix it so it compiles also
If it is linking, it means it is compiled alright first.
I am also find your code is fine, perhaps it is a linker error?
-
Jan 6th, 2002, 09:34 PM
#8
Thread Starter
Frenzied Member
I fixed it
it wasn't compiling
it just said Visual C++------Project Whatever-----------
Linking.......
0 Error(s) 0 Warning(s)
-
Jan 7th, 2002, 07:11 PM
#9
Fanatic Member
Works fine on my computer.
Alcohol & calculus don't mix.
Never drink & derive.
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
|