- 博客(4)
- 收藏
- 关注
原创 运算符“+”的重载及一些注意事项
//一般进行运算符“+”的重载的代码如下#include<iostream>using namespace std;class complex{private: int i,r;public: complex(int a=0,int b=0):r(a),i(b){}; complex operator+(complex b); void printf() ...
2018-03-31 10:33:10 174
原创 运算符>重载的运用
#include<iostream>using namespace std;class Student{private: double grade;public: Student(double a=0):grade(a){}; Student operator >(Student b); int conclusion() { if(gr...
2018-03-30 21:08:25 264
原创 简单的类的做法,尽可能用一些类的知识,不足之处请多指教
#include<iostream>#include<cstring>using namespace std;class Student{ char *name; char *num; char *sex; int year;public: Student(int ); ~Student(); void base(); voi...
2018-03-25 09:51:28 123
原创 简单的关于C++继承的封装
#include<iostream>#include<cstring>using namespace std;class Student{ char name[20]; char num[20]; char sex[4];public: void base(); void showbase();};void Student::base(){ ...
2018-03-24 21:02:56 141
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人