5 ms·
char c; do { c = getchar(); } while (c != EOF);
by tbirdz 9y ago
char c;
do {
c = getchar();
} while (c != EOF);
- noselasd 9y agoThis is worse, in most cases as you normally want to do something to c after you have read it, forcing you to re-check the condition int c; //a char can't represent EOF do { c = getchar(); if (c != EOF) { //do stuff } } while (c != EOF);