My IDE is Dev 4.0
I'm trying to figure out this for loop. It is supposed to count until the user terminates the loop but it's not working! Typing in "N" makes it go and I think it supposed to stop after each number, not keep going even if you type in "Y".
Also could someone explain the "cin.get();" thing to me? What exactly does it mean? It is not what is screwing this up but I'm just curious. As far as I've figured it out, it goes before "return 0;" and after any "cin >> something;". Thank you.Code:#include <iostream> using namespace std; int main() { int count; int response; for (count = 1; response != 'N'; count++) { cout << count << endl; cout << "Continue (Y/N): "; cin >> response; cin.get(); } cin.get(); return 0; }