30 May
2003
30 May
'03
03:11
Hi, I am writing, done actually, a littl app that carries on a few things that I ask it to do. There is a point where I need my app to wait till I press any key so it can keep moving. I tried with getchar, even doing fflush(stdin) first, but the app goes right throught it, it seems like something forces a bypass over getchar, so I decided to try read() and wait for 1 character. It works great.. but is it elegant and convenient to use a system call for a usermode app ? Shouldnt I use a library wrapper? What glibc function should I use to wait for a return(enter) or any other key to be pressed? This is C. Thanks, Raul