类对象和类指针深入分析与对比1.前言2.类指针和类对象的对比分析
1.前言Student a; s.setName("A"); //Studeng *b = new Student();Student *b;b = new Student();b->setName("B");类对象基本格式是:Student a;在定义之后就已经为a这个对象分配了内存,且为内存栈;类指针基本格式是:Student *b = new Student();