Rookie Engineer

If you aren't the kind of person that feels this way naturally, you'll need to become one in order to make it as a hacker. Otherwise you'll find your hacking energy is sapped by distractions like sex, money, and social approval.

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  24 Posts :: 0 Stories :: 2 Comments :: 0 Trackbacks

常用链接

留言簿

我参与的团队

搜索

  •  

最新评论

阅读排行榜

评论排行榜


Declaring a member function with the const keyword specifies that the function is a "read-only" function that does not modify the object for which it is called.


struct
SockAddrIn : public SOCKADDR_IN {

public:
...

bool IsEqual(const SockAddrIn& sin) const;
//A read-only function, IsEqual cannot modify any data members or call any member functions that aren't constant.
void SetAddr(SOCKADDR_IN* psin) { memcpy(this, psin, Size()); }
//A write function, cannot be const

...
};

posted on 2011-07-12 13:41 micwu 阅读(251) 评论(0)  编辑 收藏 引用 所属分类: C++

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理