cplusplus
.com
教程
參考
文章
論壇
C++
教程
參考
文章
論壇
參考
C 庫
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
C++11
<cfenv> (fenv.h)
<cfloat> (float.h)
C++11
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
C++11
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
C++11
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
C++11
<ctgmath> (tgmath.h)
<ctime> (time.h)
C++11
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
容器
C++11
<array>
<deque>
C++11
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
C++11
<unordered_map>
C++11
<unordered_set>
<vector>
輸入/輸出
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
多執行緒
C++11
<atomic>
C++11
<condition_variable>
C++11
<future>
C++11
<mutex>
C++11
<thread>
其他
<algorithm>
<bitset>
C++11
<chrono>
C++11
<codecvt>
<complex>
<exception>
<functional>
C++11
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
C++11
<random>
C++11
<ratio>
C++11
<regex>
<stdexcept>
<string>
C++11
<system_error>
C++11
<tuple>
C++11
<type_traits>
C++11
<typeindex>
<typeinfo>
<utility>
<valarray>
操縱符
參考
操縱符
<ios> <iostream>
std::
manipulators
流操縱運算元
操縱運算元是專門設計的函式,用於配合流物件的插入(
<<
)和提取(
>>
)運算子一起使用,例如
1
cout << boolalpha;
它們仍然是常規函式,也可以像任何其他函式一樣呼叫,使用流物件作為引數,例如
1
boolalpha (cout);
操縱運算元用於更改流上的格式化引數,以及插入或提取某些特殊字元。
基本格式標誌
這些操縱運算元可以在輸入和輸出流上使用,儘管許多操縱運算元僅在應用於輸出或輸入流時才有效。
獨立標誌(開啟)
:
boolalpha
布林值的字母數字表示
(函式)
showbase
顯示數值基數字首
(函式)
showpoint
顯示小數點
(函式)
showpos
顯示正號
(函式)
skipws
跳過空白字元
(函式)
unitbuf
插入後重新整理緩衝區
(函式)
uppercase
生成大寫字母
(函式)
獨立標誌(關閉)
:
noboolalpha
不使用布林值的字母數字表示
(函式)
noshowbase
不顯示數值基數字首
(函式)
noshowpoint
不顯示小數點
(函式)
noshowpos
不顯示正號
(函式)
noskipws
不跳過空白字元
(函式)
nounitbuf
插入後不強制重新整理
(函式)
nouppercase
不生成大寫字母
(函式)
數值基數格式標誌(“basefield”標誌)
:
dec
使用十進位制
(函式)
hex
使用十六進位制
(函式)
oct
使用八進位制
(函式)
浮點格式標誌(“floatfield”標誌)
:
fixed
使用定點浮點表示法
(函式)
scientific
使用科學計數浮點表示法
(函式)
調整格式標誌(“adjustfield”標誌)
:
internal
透過在內部位置插入字元來調整欄位
(函式)
left
將輸出左對齊
(函式)
right
將輸出右對齊
(函式)
輸入操縱運算元
ws
提取空白字元
(函式)
輸出操縱運算元
endl
插入換行符並重新整理
(函式)
ends
插入空字元
(函式)
flush
重新整理流緩衝區
(函式)
引數化操縱運算元
這些函式在用作操縱運算元時需要引數。 它們需要顯式包含標頭檔案
<iomanip>
.
setiosflags
設定格式標誌
(函式)
resetiosflags
重置格式標誌
(函式)
setbase
設定基數字段標誌
(函式)
setfill
設定填充字元
(函式)
setprecision
設定小數精度
(函式)
setw
設定欄位寬度
(函式)