A
Aniruddha
I had posted this to comp.os.msdos but I did not get an answer.
The program
// Hello.cpp
#include <iostream.h>
#include <stdio.h>
int main ()
{
printf ("Line1 \n");
cout<< "Line2 \n" ;
printf ("Line3 \n");
cout<< "Line4 \n" ;
printf ("Line5 \n");
cout<< "Line6 \n" ;
return 0;
}
when the output was redirected to a file:
c:\tc\bin> hello > a.txt
I could see all the 'cout' lines printed first and then printf lines.
Shouldn't it be in the same order as it appears? Why is it happening?
I am using the Turbo C++ 3.0 compiler.
The program
// Hello.cpp
#include <iostream.h>
#include <stdio.h>
int main ()
{
printf ("Line1 \n");
cout<< "Line2 \n" ;
printf ("Line3 \n");
cout<< "Line4 \n" ;
printf ("Line5 \n");
cout<< "Line6 \n" ;
return 0;
}
when the output was redirected to a file:
c:\tc\bin> hello > a.txt
I could see all the 'cout' lines printed first and then printf lines.
Shouldn't it be in the same order as it appears? Why is it happening?
I am using the Turbo C++ 3.0 compiler.