From: Budi Rahardjo (rahardj@ccu.umanitoba.ca)
Date: 05/26/92


From: rahardj@ccu.umanitoba.ca (Budi Rahardjo)
Subject: Problem with gcc 2.1 (why do I have to flush stdout?)
Date: 26 May 1992 18:52:18 GMT


I have problem with gcc 2.1 with a simple (test) program :

#include <stdio.h>
char line[255];
main(argc, argv)
int argc; char *argv[];
{
        printf("Testing gcc 2.1\n");
        printf("Enter a string: ");
        scanf("%s", line);
        printf("You entered: %s\n", line);
        printf("Enter another string: "); /* I have to flush stdout */
        scanf("%s", line);
        printf("You entered %s\n", line);
}

When I try to run it, it won't display the "Enter another string:".
I have to flush stdout explisitly to display it. What gives ?
Is this a gcc bug or somehere something is buffering my stdout...

Thanks
-- budi

-- 
Budi Rahardjo <rahardj@ccu.umanitoba.ca>
Unix Support - Computer Services - University of Manitoba