left
產生不同的外觀,例如輸出寬度顯示於資料流注意內容以左框線的文字。
ios_base& left(
ios_base& _Str
);
參數
- _Str
參考型別 ios_base物件,或是繼承自 ios_base的型別。
傳回值
對 _Str 衍生的物件參考。
備註
操作工具有效地呼叫 _Str.setf(ios_base::left, ios_base::adjustfield),則傳回 _Str。
範例
// ios_left.cpp
// compile with: /EHsc
#include <iostream>
int main( )
{
using namespace std;
double f1= 5.00;
cout.width( 20 );
cout << f1 << endl;
cout << left << f1 << endl;
}
需求
標題: <ios>
命名空間: std