| <<< Field Alignment | Index | Scientific Notation >>> |
Adjusting numeric fields:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int x = -1234;
cout << setw( 10 ) << internal << x << '\n';
cout << setw( 10 ) << left << x << '\n';
cout << setw( 10 ) << right << x << '\n';
return 0;
}
/*
Output:
- 1234
-1234
-1234
*/
| <<< Field Alignment | Index | Scientific Notation >>> |