reading one character
i want to read one character and the echo it on screen. i want to do this only using standard c libraries on linux (something like getch() from conio.h) How can I do that?
I tryed:
#include<stdio.h>
int main()
{
int c;
c=getc(stdin);
printf("%c\n",c);
return 0;
}
it reads a string and prints only the first character. how can i make it stop afer reading the first character!
|