cout與printf的混用問題

在某題的輸出混用了cout與printf(),結果輸出的順序出錯。 把緣由歸結爲一個帶緩衝而一個不帶緩衝。 由於stdio.h中定義了像ungetc()這樣的函數,其做用是將字符放回到輸入流中。可見stdio中也是使用了緩衝的。 那麼爲何cout與printf()混用會發生問題呢?ios #include <iostream> using namespace std; int main()
相關文章
相關標籤/搜索