Hi.
I was wondering is there anyway i can put in different value into my while structure so i don't have to make more switches?
Thanks alot.
p.s. my user defined types in the enum i was thinking could be used in the while structure .
Code:#include <iostream> using namespace std; void started ( void ); // function prototype :1 int option1; int main() { cout <<"Hi welcome to the driving program" << endl <<"\nPlease press: 2 to start engine" << endl; while ( ( option1 = cin.get() ) != EOF ) { // put in different option in while structure. switch ( option1 ) { case '2': started(); break; // to exit switch } } return 0; } void started ( void ) // function def :1 { cout << "Engine started" << endl; } //enum GEARS { reverse, first, second, third, fourth, fifth }; // starts at 0 and increments by 1



LinkBack URL
About LinkBacks


