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

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

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

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