作者tinlans ( )
看板Programming
标题Re: 请问C++ Class中 const static object 的life …
时间Fri Sep 19 06:33:23 2008
※ 引述《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 (
[email protected])
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)