Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

how to read keyboard input in c

#include <stdio.h>

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

    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #keyboard #input
ADD COMMENT
Topic
Name
8+4 =