Other source of error?
所在版块:社会百科 发贴时间:2003-06-05 10:10

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
Flying, i investigate it again. I think the problem may caused by the initialization of farray.

In the public part, i defined some public functions, and i initialize the farray with these public functions.

Class Object
{
public:
void retrieve() {...}
void insert() {...}
void update() {...}

private:
typedef void (Object::*Omf)();
Omf farray[3];
};

Object::Omf Object::farray[3]=
{
&Object::retrieve, &Object::insert, &Object::update
};

&Object::retrieve and such are fixed addresses, so farray must be defined as static, correct? Is this a rule defining a static member?
What are the rules for definition of static members?

TIA
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Never frown even though tomorrow may be grey, may be blue
Who knows who will love your smile in next minute
 相关帖子 我要回复↙ ↗回到正文
C++ question: static graduating   (471 bytes , 575reads )
my thots VeryGood   (297 bytes , 391reads )
Seems to be a reason graduating   (100 bytes , 195reads )
followon question graduating   (335 bytes , 239reads )
It seems that you are confused... Flying   (363 bytes , 261reads )
OS: Sun Solaris 2.6 graduating   (57 bytes , 211reads )
1-yes, 2-no graduating   (493 bytes , 269reads )
I saw your problem. But I don't think that's the Flying   (252 bytes , 263reads )
Other source of error? graduating   (649 bytes , 260reads )
only a static member can be initialize in this way VeryGood   (53 bytes , 349reads )
Many thanks to you two. This post encloses graduating   (29 bytes , 220reads )