When I run the code, what's supposed to happen is that when I input three numbers separated by spaces (e.g. "23 4 5 <enter>"), it outputs "no more input\n\nReady\n", when I input four or more numbers (e.g. "23 4 5 34 65 <enter>"), it outputs "is more input\n\nReady\n":
#include "stdafx.h"
#include <iostream>
#include <limits>
using namespace std;
void main(){
int a[3];char b[2];
start:
cout<<"\n\nReady\n";
cin>>a[0]>>a[1]>>a[2];
cin.get(b,2);
if(*b==NULL) cout<<"no more input";
else cout<<"is more input";
cin.ignore(numeric_limits<streamsize>::max(),'\n');
goto start;
}
But it doesn't work if I input three numbers: it outputs "ready\n\nno more input\nready\n\nno more input\n..." without waiting for me to press enter.
Thanks in advance for answering my question.