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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -

openssl - Load PKCS#8 binary key into Ruby -