Subject: RE: bash-shell output
From: [email-masked] (Howarth, Richard)

4 Feb 1998 13:40:21 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/mixed;
	boundary="---- =_NextPart_000_01BD3192.3B62F850"
To: [email-masked]

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_000_01BD3192.3B62F850
Content-Type: text/plain

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:[email-masked]]
> Sent: 	05 February 1998 01:07
> To: 	[email-masked]
> Cc: 	[email-masked]
> 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
> "[email-masked]" with one line of text: "help".
> 

------ =_NextPart_000_01BD3192.3B62F850
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64

------ =_NextPart_000_01BD3192.3B62F850--
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".