Hi,
I am changing to work in C++ from C. In my C++ code, I have a line like this
Code:
printf("%d %d %d %d \n", x0,y0,x1,y1);
There is nothing printed out on the console. If I call cout next, then I can get the output of both
Code:
printf("%d %d %d %d\n", x0,y0,x1,y1);
cout<<x0<<" "<<y0<<" "<<x1<<" "<<y1<<endl;
It is like cout push printf to do what it is supposed to. Any idea how to correctly use printf in C++? Thanks!
Update:
There was mistake in my first post.
with "\n" printf works, while without "\n" it doesn't.
Just out of curiosity, why the latter happens?