Reading input by calling getc()

Tuesday, October 14, 2014
/* Reading input by calling getc() 0501 */
#include <stdio.h>

main()
{
    int ch;

    printf("Please type in one character:\n");
    ch = getc( stdin );
    printf("The character you just entered is: %c\n", ch);
    printf("The character you just entered is: %d\n", ch);
    return 0;
}

Copyright @ 2015 Tron!

Labels

Blog Archive