遇君阁

前不见古人,后不见来者
念天地之悠悠,独怆然而涕下

  VC知识库BLOG :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 登录 ::
  26 随笔 :: 8 文章 :: 53 评论 :: 0 Trackbacks
<2008年3月>
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345

留言簿(0)

随笔分类

随笔档案

文章分类

文章档案

相册

相关链接

搜索

最新评论

阅读排行榜

评论排行榜

2008年3月7日 #

I want to recogonize the content of a class, which part is declaration and which part is defination.
// A.h header file
// class A is a defination.
class A
{
public:
         int a;     // a is a defination
         static int b;       // b is a declaration, you will difine it outside this class
         int getValue();        // method getValue is a declaration., you will difine it outside this class
         // method getValue1 is a defination, it is inline function.
         int getValue1()
         {
                  return a;
         }
};

Because somebody only declare some var or method in class, but don't define them, especially like static variable. If you don't define it, you will get a link error:
unresolved external symbol

发表于 2008-03-07 15:16 遇君阁 阅读(582) | 评论 (0)编辑 收藏