cout printf 区别

cout多线程执行写入会随机排列字符串。

printf多线程执行写入会顺序排列字符串。

举例

cout:

threthrad1st

eadart...1stthra

ead1start...rt...

printf:

thread1start...

thread2start...

thread3start...

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

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