Aligning text to the right in the C++ console -


how format console output it's aligned right in c++?

use manipulator flag std::right

example

or

this works...

#include<iostream> using std::cout; using std::endl;   #include<iomanip> using std::setw;  int main(){   int x = 12345;   cout << "blah blah blah" << endl << setw(80) <<  x << endl;   system("pause");   return 0; } 

Comments

Popular posts from this blog

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -