cout printf 區別

cout多線程執行寫入會隨機排列字符串。

printf多線程執行寫入會順序排列字符串。

舉例

cout:

threthrad1st

eadart...1stthra

ead1start...rt...

printf:

thread1start...

thread2start...

thread3start...

都是輸出了字符串,但是字符串的排列順序不同。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章