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