This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

stdio on bash shell/emacs


hi. i've got a c program that works fine through cygwin bash. when i run it
from emacs bash on windows, the stdio no longer works. after trolling around
on the user groups, i found that using fflush(stdout) will allow a printf to
work. however, a call to kbhit() only returns true on Ctrl-C. does anyone
have any ideas about this. (here's the code:)


int main(int argc, char* argv[])
{
   while( !kbhit() )
   {
      printf("Hit me\n");
	fflush(stdout);
   }
   printf( "\nKey struck was '%c'\n", _getch() );
   fflush(stdout);
  return 0;
}

-thanks,
	aaron

Aaron Edsinger
Living Machines Group
MIT Artificial Intelligence Lab
617.253.6532


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]