By best guess is that somehow the input stream is corrupted, so that the failbit or eofbit or badbit etc is set somewhere in the loop, which will cause all further attempts to getline() to be ignored.
Try adding a clear() and see if that helps:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
#include <string>
usingnamespace std;
int main () {
char a[20];
for (; !cin.eof();) { // <--
cout << "ENTER: ";
cin.clear(); // <--
cin.getline(a, 10);
cout << a << endl;
}
cout << "All done." << endl;
return 0;
}