delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/30/16:59:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Aaron Edsinger" <edsinger AT ai DOT mit DOT edu>
To: <cygwin AT cygwin DOT com>
Subject: stdio on bash shell/emacs
Date: Thu, 30 Jan 2003 16:59:59 -0500
Message-ID: <COECKNPCJNKIBAJJAHLIAECPCNAA.edsinger@ai.mit.edu>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019