I searched the forum on this but didn't find what I was looking for. I know this has been discussed before but I couldn't find anything. So anyway, what is the best way to read a character from stdin without having to hit 'return'?
#include <stdio.h>
main(int argc, char** argv)
{
char iochar;
while((iochar=getchar())!=EOF)
putchar(iochar);
return(0);
}
In the above example you have to hit 'return' because the input is buffered. I just want to hit 'a' or something and have the program react immediately w/o hitting 'return'...possible?
Thanks,
bitwise
#include <stdio.h>
main(int argc, char** argv)
{
char iochar;
while((iochar=getchar())!=EOF)
putchar(iochar);
return(0);
}
In the above example you have to hit 'return' because the input is buffered. I just want to hit 'a' or something and have the program react immediately w/o hitting 'return'...possible?
Thanks,
bitwise