#include /** * Just shows the process of reading character by * character from the standard input and then the * equivalence of char and int * @author: gtowell * Created: Feb 2021 * */ int main(void) { char c; while (EOF != (c=getchar())) { //char c = getchar(); //if (EOF==c) // break; int i = (int)c; char cc = (char)i; printf("before:%c as int:%d after:%c\n", c, i, cc); printf("Printing a char: as char:%c as int:%d\n", c, c); printf("Printing an int: as char:%c as int:%d\n\n", i, i); } }