Control string

Hello.
As far as I know ..
In the programming language c #
Have the option of the "Control string"
Marked by (for example) "% 4d"
It makes for "printf" to assign each number, print width of 4 characters.
Do I have the ability to do the same also in c + +?
Thank you for helping!
Yes. You would use iostream manipulators for that (if you are using std::cout).
Thank you,
I use "using namespace std;"
Not really understand what you mean ..
Can you add an example?
Here is a specific one: http://www.cplusplus.com/reference/iostream/manipulators/setw/
If you want the complete reference to C++ manipulators see http://www.cplusplus.com/reference/iostream/manipulators/
- although streams are better, you can use printf also in C++ -
Thank you guys I really appreciate it :)
Last edited on
Topic archived. No new replies allowed.