bash-shell output
Howarth, Richard
rhowarth@sgb.co.uk
Wed Feb 4 09:10:00 GMT 1998
fflush expects a file descriptor, so passing NULL is definately not
going to work.
Assuming you want to force the output from the printf statement, use
fflush(stdout);
> ----------
> From: Nils Goesche[SMTP:ngo@wossolit.teles.de]
> Sent: 05 February 1998 01:07
> To: gnu-win32@cygnus.com
> Cc: ntemacs-users@cs.washington.edu
> Subject: bash-shell output
>
> Hi!
>
> The following program doesn't work properly when run from bash
> (with `M-x shell' from within Emacs):
>
> #include <stdio.h>
>
> int main()
> {
> int i;
>
> printf("Enter number: ");
> /* fflush(NULL); */
> scanf("%d", &i);
> printf("Got %d.\n", i);
> return 0;
> }
>
> You have to uncomment that fflush-line. But the usual shells
> like command.com or 4nt don't need that line. This is somewhat
> annoying. Can I at least force the shell somehow to flush
> input/output buffers? Some other programs are just unusable
> because of this behavior.
>
> --
> Nils Goesche
> My obscure opinions are my very own.
>
> -
> For help on using this list (especially unsubscribing), send a message
> to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00000.bin
Type: application/vnd.ms-tnef
Size: 2138 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/19980204/58b9081e/attachment.tnef>
More information about the Cygwin
mailing list