Aligning text to the right in the C++ console -
how format console output it's aligned right in c++?
use manipulator flag std::right
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
Post a Comment