• 论坛网址:https://dianbai.wiki(可微信分享)、https://0668.es、https://0668.cc(全加密访问)

ns问题 (1人在浏览)

happy

荣誉会员
荣誉会员
注册
2004-08-21
帖子
148,244
反馈评分
0
点数
61
请教一个问题: 在ns的ping.h中,定义了hdr_ping结构,其中里面定义了static int offset_;
但是再ping.cc里面,我发现在开头又定义:int hdr_ping::eek:ffset_;请问 后面的定义是否有必要?
我发现不少的源码都是这样的,我感觉是与该变量的static性质有关,但具体为何不知,望指教
 
那里一样int hdr_ping::eek:ffset_
这里的offset_是派生hdr_ping这个
跟前面的static int offset_是两马事
int hdr_ping::eek:ffset里的offset的结构是hdr_ping类
offset是hdr_ping的对象,明白
 

正在浏览此帖子的用户

后退
顶部