C++ 常見錯誤總結

1,字符串」Hello」會被輸出幾回?程序員 int main() { printf("Hello"); fork(); printf("Hello"); } 這個題目,若不注意,會覺得輸出三個Hello。可是實際上輸出四個。可是: print輸出字符串若是不是一」\n」爲結尾的話,就不會立刻輸出,而是保存在緩存區中。fork函數在建立子進程的時候會複製緩存區的數據。web 2,++i 和
相關文章
相關標籤/搜索