Hi guys!
I'm having an issue like these below examples:
Example:
I have a variable: x = 1.2345 and I want to output "x = 1.23" to the screen.
Therefore, in C, I have this code
Another example:
x = 1; y = 2; z = 3;
I want to output "1 2 3" to the screen.
So I use this C code:
|
printf("%4d %4d %4d", x, y, z);
|
So the question is: "
Is "cout" in C++ able to do the same? Syntax?"
Many thanks!
(I'm so sorry if my English is bad, because it is not my mother language)
Last edited on
Last edited on