在main.cpp 中並沒有宣告 v ,只是以 extern 聲明 v 是在其他地方定義,編譯器會試著找出符合的 v ,結果在foo.cpp 找到,因而會顯示結果為1000,要注意的是, extern 聲明 ...
確定! 回上一頁