討論串請問C++ Class中 const static object 的life …
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
我一開始看的時候就很好奇,. 為什麼你不這樣寫?. class C {. static const string foo;. };. const C::string foo("hello");. --. Ling-hua Tseng (uranus@tinlans.org). Department
(還有175個字)
內容預覽:
這種寫法會... compile error. 型別不對. 所有const static member data會在main function之前完成初始化的動作. 在main function結束之前被消滅. 但是你是用指標 指向一個匿名的暫時物件. 雖然會指標會初始化 指標會消滅. 但是它所指向
(還有910個字)
首頁
上一頁
1
下一頁
尾頁