C++ IOS庫 - 與Stdio同步



描述

它用於切換與cstdio流的同步[靜態]。如果在程式執行其第一個輸入或輸出操作之前呼叫它,則會開啟或關閉所有iostream標準流與其對應的標準C流的同步。

bool sync_with_stdio (bool sync = true);

宣告

以下是ios_base::sync_with_stdio函式的宣告。

bool sync_with_stdio (bool sync = true);

引數

sync − 布林引數,指示是否要開啟或關閉同步:值為true請求開啟同步,而值為false請求關閉同步。

返回值

返回呼叫前的同步狀態。

異常

基本保證 − 如果丟擲異常,則流處於有效狀態。

資料競爭

它可能會修改流物件。

ios.htm
廣告
© . All rights reserved.