Ok, I'm working on an NPC Library for future use and I've come across trouble. Here's the function code:
The execution stops after the second cin, why?Code:NPC::CLS_FIND() { clsno=0; while(clsno<1||clsno>3) { system("cls"); cout << "How many classes?" << endl; cin >> clsno; cout << endl; if(clsno<1||clsno>3) { cout << "Invalid Number of Classes!" << endl; cout << "Must Be Between 1-3!" << endl; getch(); } } lp=0; while(lp!=clsno+1) { system("cls"); if(lp==1) { cout << "What is Class 1?" << endl; cin >> cls1; } else if(lp==2) { cout << "What is Class 2?" << endl; cin >> cls2; } else if(lp==3) { cout << "What is Class 3?" << endl; cin >> cls3; } lp++; } return 0; }