If I write code like this:
int a = 123456; cout << setw(20) << setiosflags(ios::right) << a << endl; cout << setiosflags(ios::left) << setw(20) << a << '*' << endl; On the 3rd line, I set the alignment as left align, so my expected output is
123456 123456 *
but the REAL output is
123456 123456*
Why did that happen?
The IDE I use is DevCpp.