Mega Code Archive

 
Categories / C++ Tutorial / Development
 

Printing an integer with internal spacing and plus sign

#include <iostream> using std::cout; using std::endl; using std::internal; using std::showpos; #include <iomanip> using std::setw; int main() {    cout << internal << showpos << setw( 10 ) << 123 << endl;    return 0; } + 123