ok i dont understand this...maybe someone can help me...
Alrite that is the version that works...but now if you take out the 'do while' statement....it suddenly doesnt work...it just skips over to the 'return 0;' i dont understand what my loop is doing...i was like all ........ed off...determined not to go to bed till i fixed it...heh...yea im not the bestest programmer...but im learning...Code:#include <iostream> #include <windows.h> #include <time.h> #include <iomanip> using namespace std; int main() { int choice; int reuse(0); const int MAX=80; char Intro[]("THE BATTLE WITHIN"); char name1[MAX]; cout <<setw(45)<<Intro; /*Sleep(1000*2);*/ BEGIN: /*Sleep(1000*2);*/ system("cls"); cout <<"Declare your choosing:\n" <<"1)Begin a new journey.\n" <<"2)Continue your journey.\n" <<"3)Exit.\n"; cin >>choice; if(choice==1) {goto Start;} if(choice==2 || choice==3) {goto END;} else { reuse++; if(reuse==2) { cout <<"You have angered me...\n"; Sleep(1000); cout <<"LEAVE!\n"; return 0; } else cout <<"Maybe your finger slipped...\n" <<"Or maybe you are just an idiot...\n" <<"Whatever the case...dont do it again...\n"; goto BEGIN; } Start: reuse=0; //Right here... cout <<"Welcome\n"; //i had to rig it all weird like this... do //im just wondering why... { cin.getline(name1,MAX,'\n'); reuse++; }while(no<2); cout <<name1; END: return 0; }



LinkBack URL
About LinkBacks



