
类
文章平均质量分 62
来自夏尔的Jenny
这个作者很懒,什么都没留下…
展开
-
使用引用改变类里变量的值
#include #include using namespace std;class Student{public: int id; char name[50]; // Data field int age; // Data field Student(int d){ id = d; strcpy(name,"no name");原创 2017-03-17 12:22:18 · 533 阅读 · 0 评论 -
A Class with Dual Role
DescriptionThere is a class B and another class D. Their relationship is as following:B is the base class of D and at the same time, D has a object member of the type of class B, as shown below.原创 2017-06-24 17:09:17 · 348 阅读 · 0 评论