// Read characters until eof // Andrew Taylor - andrewt@unsw.edu.au // June 2021 #include int main(void) { // getchar returns an int which will contain either // the ASCII code of the character read or EOF int ch = getchar(); while (ch != EOF) { printf("'%c' read, ASCII code is %d\n", ch, ch); ch = getchar(); } return 0; }