I am changing to work in C++ from C. In my C++ code, I have a line like this
There is nothing printed out on the console. If I call cout next, then I can get the output of bothCode:printf("%d %d %d %d \n", x0,y0,x1,y1);
It is like cout push printf to do what it is supposed to. Any idea how to correctly use printf in C++? Thanks!Code:printf("%d %d %d %d\n", x0,y0,x1,y1); cout<<x0<<" "<<y0<<" "<<x1<<" "<<y1<<endl;
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?