This question already has an answer here:
- Formatting output in C++ 6 answers
Here’s what i normal do in c code:
Printf(“%-40s = 42\n”, “life”)
“Life”will be left justified with spaces padding on right...
How can I accomplish the same thing in c++ cout style code?
(Sorry... I’ve been dragging my feet for years when it comes to use using cout over printf)
Aucun commentaire:
Enregistrer un commentaire