help-emacs-windows
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [h-e-w] printf order in emacs shells


From: Sayth Renshaw
Subject: Re: [h-e-w] printf order in emacs shells
Date: Tue, 28 Jun 2011 13:30:52 +1000

On Tue, Jun 28, 2011 at 1:33 AM, Jason Rumney <address@hidden> wrote:
> Sayth Renshaw <address@hidden> writes:
>
>> # include <stdio.h>
>> int main()
>> {
>>   float a,b,c,interest;
>>   printf("Type in amount in dollars cents:\n");
>
> fflush(stdout);
>
>>   scanf("%f",&a);
>>   b = 0.075;
>>   c = a * b;
>>   interest = a + c;
>>   printf("The total including interest is $%.2f", interest);
>>     return 0;
>> }
>
> Windows automatically flushes the output before a scanf if stdout/stdin
> is a console window, but it does not if they are redirected to another
> program.
>

Thanks heaps. I went on a big side track thinking it was an emacs issue.

Sayth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]