class Student
{
public:
static int number;
string name;
public:
Student() { }
};
int main(int argc, char** argv)
{
Student* s1;
s1 = new Student();
Student s2;
return 0;
}
1)类的指针:Student* s1; 还没有分配内存,他是一个内存地址值,他指向内存中存放的类对象(包括一些成员变量所赋的值)
2)对象,他是利用类的构造函数在内存中分配一块内存(包括一些成员变量所赋的值).