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>
<iostream>
物件
、cerr
cin
、clog
、cout
、wcerr
wcin
、wclog
、wcout
參考
<iostream>
、clog
物件
<iostream>
std::
clog
extern ostream clog;
用於記錄的標準輸出流
類
ostream
的物件,它代表了面向窄字元(型別為
char
)的
標準日誌流
。它與
cerr
一起,對應於
C 流
stderr
。
標準日誌流
是環境所確定的字元目標。此目標可以由多個標準物件(如
cout
或
cerr
)共享。
作為類
ostream
的物件,可以透過插入運算子(
operator<<
)格式化寫入資料,也可以使用成員函式(如
write
)以未格式化的方式寫入資料。
該物件在標頭檔案
<iostream>
中宣告,具有
外部連結
和
靜態儲存期
:它在程式的整個生命週期內都存在。
就
靜態初始化順序
而言,
clog
保證在構造
ios_base::Init
型別的物件時,至少不晚於該物件被構造完成。
就
靜態初始化順序
而言,
clog
保證在構造
ios_base::Init
型別的物件時,至少不晚於該物件被構造完成,而包含
<iostream>
則至少會導致一次具有
靜態儲存期
的此類物件的初始化。
clog
不會
關聯
到任何其他流(參見
ios::tie
)。
預設情況下,
clog
與
stderr
同步(參見
ios_base::sync_with_stdio
)。
程式不應將對
clog
的輸出操作與對
wclog
或
wcerr
(或與對
stderr
的其他面向寬字元的輸出操作)的輸出操作混合:一旦對其中任何一個進行了輸出操作,
標準日誌流
就會獲得一個方向(
窄
或
寬
),該方向只能透過對
stderr
呼叫
freopen
來安全地更改。
有關
clog
支援的操作的更多資訊,請參閱其型別的參考:
ostream
。
另見
ostream
輸出流
(類)
、cout
標準輸出流
(物件)
、cerr
標準錯誤輸出流
(物件)
cin
標準輸入流
(物件)
、wclog
標準日誌輸出流 (寬)
(物件)