Re: 請問C++ Class中 const static object 的life …
※ 引述《sorryChen (陳揚和)》之銘言:
: 標題: Re: 請問C++ Class中 const static object 的life …
: 時間: Fri Sep 19 02:49:14 2008
:
: 感謝大師的指點, memory leak就是我要問的
: 所以其實不應該用指標 不然就得自己在main 結束前把它delete 掉
: 是這樣吧
:
: 非常感謝
:
: → sorryChen:可是不用指標好像沒辦法initialization 128.125.87.33 09/19 03:41
我一開始看的時候就很好奇,
為什麼你不這樣寫?
class C {
static const string foo;
};
const C::string foo("hello");
--
Ling-hua Tseng (uranus@tinlans.org)
Department of Computer Science, National Tsing-Hua University
Interesting: C++, Compiler, PL/PD, OS, VM, Large-scale software design
Researching: Software pipelining for VLIW architectures
Homepage: https://www.tinlans.org
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.105.237
※ 編輯: tinlans 來自: 118.160.112.118 (10/15 15:22)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 4 篇):