我有一行代碼將填充值設置爲我的輸出中的' - '字符,但需要將setfill標誌重置爲其默認空白字符。我怎麼做?如何重置輸出流操縱器標誌
cout << setw(14) << " CHARGE/ROOM" << endl;
cout << setfill('-') << setw(11) << '-' << " " << setw(15) << '-' << " " << setw(11) << '-' << endl;
我想這可能工作:
cout.unsetf(ios::manipulatorname) // Howerver I dont see a manipulator called setfill
上午我在錯誤的軌道上?
偉大的答案,應該是接受一個。 – gd1 2015-09-29 09:43:50
@ gd1:很好的答案,但不是_great_,因爲我必須包含Boost才能保存iostream標誌。 – Isaac 2016-01-05 08:41:44
@Isaac:在C++中,在我看來,您要麼使用boost或最終重新實現它,要麼等待Boost.Something被包含在標準中。 – gd1 2016-01-07 18:32:00