对象赋值在C++中的实现
对象赋值:class Student { string name; int semesHours; public: Student(string pName="", int i=0) { name = pName; semesHours = i; } }; Student a("jenny", 50); Student b; b = a; 这是一个已知对象赋值给另一个已知对象的示例,利用赋值运算符重载实现。
2.25MB
文件大小:
评论区