推 littleshan:因為 time 是標準函式庫中的函式,你撞名了 12/04 11:10
可是我也嘗試過 class name 改成 Time 和 TIME 也不行
C++不是 對大小寫會分辨嗎 要是換個名稱應該可以吧
※ 編輯: steve1012 來自: 114.34.202.142 (12/04 11:28)
推 littleshan:我可以啊,你看看錯誤訊息吧 12/04 11:44
比如說我寫 time t;
error message 要我在t前面加分號
所以要使用自定義型別需要寫成
class time t;
不能time t;的意思嗎
※ 編輯: steve1012 來自: 114.34.202.142 (12/04 12:08)
推 cuteclare:在win下是不會分大小寫的~ 12/04 12:30
→ cuteclare:#include <cstdio> 跟 #include <CSTDIO> 個人在win下 12/04 12:32
→ cuteclare:用gcc 都可以編譯過-.- 很神奇 orz 12/04 12:32
→ BombCat:C跟C++都是case sensitivity 12/04 12:40
→ BombCat:能include是因為windows的file sysyem不分大小寫 12/04 12:41
推 s3748679:沒猜錯的話,加了class可以讓編譯器辨識為類別而不是函數 12/04 13:26
→ uranusjr:請愛用 namespaces... 12/04 13:43
推 flylover:改個class名吧 12/05 13:10