[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using shell & shell alternatives
From: |
Pascal J. Bourguignon |
Subject: |
Re: using shell & shell alternatives |
Date: |
Wed, 28 Mar 2012 19:17:54 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
flebber <flebber.crue@gmail.com> writes:
> Whilst using the shell M-X shell. I notice some odd behaviour
> regarding C(language) and handling of printf and scanf.
>
> It seems the default shell puts a lower precedence to printf. So that
> the output for a simple script such as this;
>
> #include <stdio.h>
>
> int main()
> {
> int a, b, c;
> printf("Enter the first value:");
> scanf("%d", &a);
> printf("Enter the second value:");
> scanf("%d", &b);
> c = a + b;
> printf("%d + %d = %d\n", a, b, c);
> return 0;
> }
Where are the calls to fflush?
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.