Answers for "how to detect keyboard input in c"

C
0

how to read keyboard input in c

#include <stdio.h>

int main(int argc, char *argv[])  
{
    printf("Enter some keysn");
    char c;
    while((c = getchar()) != 13)   /* 13 is carriage ret in ascii, enter key */     
        printf("%cn", c); 

    return 0;
}
Posted by: Guest on June-11-2021

Code answers related to "how to detect keyboard input in c"

Code answers related to "C"

Browse Popular Code Answers by Language