1 中括号重载.cpp#include#includeusing namespace std;class my_string{ char* p=nullptr; public: my_string(){} my_string(const char* s){ ... Read More
posted @ 2016-03-30 13:43
夜色下的港湾
Views(1560)
Comments(0)
Diggs(0)
1 C++ 重载输出符号.cpp#includeusing namespace std; struct Date{ int year,month,day; Date()=default; Date(int y,int m, int d) :year(... Read More
posted @ 2016-03-30 13:41
夜色下的港湾
Views(353)
Comments(0)
Diggs(0)
1 单目运算#includeusing namespace std;//复数class Complex{ public: double real,image; Complex()=default; Complex(double r, double i) ... Read More
posted @ 2016-03-30 13:39
夜色下的港湾
Views(296)
Comments(0)
Diggs(0)
#includeusing namespace std;int add(int a, int b){ return a+b;}int main(){ string s1 ="abc"; string s2 ="def"; string s3 = s1 + s... Read More
posted @ 2016-03-30 13:36
夜色下的港湾
Views(126)
Comments(0)
Diggs(0)
1成员函数重载#include#includeusing namespace std;class Cycle;class Point{ double x,y; public: Point()=default; Point(double rx ,double ... Read More
posted @ 2016-03-30 13:35
夜色下的港湾
Views(160)
Comments(0)
Diggs(0)
01_point.cpp #include#includeusing namespace std;class Point{ double x,y; public: Point()=default; Point(double rx ,double ry) ... Read More
posted @ 2016-03-30 13:32
夜色下的港湾
Views(141)
Comments(0)
Diggs(0)
01 _static.cpp#includeusing namespace std;struct student{ int id; string name;static string school; student()=default; student(i... Read More
posted @ 2016-03-30 13:29
夜色下的港湾
Views(254)
Comments(0)
Diggs(0)
01_const_class.cpp#includeusing namespace std;struct A{ int m; int n; A(){} A(int a,int b){m=a;n=b;} ~A(){}};int main(){ co... Read More
posted @ 2016-03-30 10:54
夜色下的港湾
Views(193)
Comments(0)
Diggs(0)
1_student_link_list.cpp#includeusing namespace std;struct student{ int id;string name;int age; student()=default; student(int i,stri... Read More
posted @ 2016-03-30 10:52
夜色下的港湾
Views(241)
Comments(0)
Diggs(0)
01_初始化参数列表.cpp#include#include #include using namespace std;struct Student{ int id=1001;//成员变量或对象 char *name=nullptr; int age=20; ... Read More
posted @ 2016-03-30 10:48
夜色下的港湾
Views(298)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号