0

For some reason this code is not correctly displaying the output....Is it a compiler issue? I'm not getting any affect from the width method, nor from the fill method. However, when I include <iomanip> and make a call to setw(int) then it works, but this code doesn't:

Code:

#include <cstdlib> #include <iostream> int main() { std::cout << "This is some text"; std::cout.width(5); std::cout.fill('*'); std::cout << "\nThis is some other text"; int x; std::cin >> x; return 0; }


NOTE: I use bloodshed

1
Contributor
1
Reply
2
Views
11 Years
Discussion Span
Last Post by server_crash
0

I figured this crap out. It's just that the width doesn't apply to only the fill, but to the buffer/line of text as a whole.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.