
C++学习
静安书以沫
知识是一点点积累的,路是一步步走出来的
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++类与对象
#include<iostream.h>using namespace std;class clock{ public : void settime(int new_hour,int new_minute,int new_second); void showtime(); private: int hour,minute,second;};void clock::settime(int new_hour,int new_minute,int new_second){原创 2020-11-05 09:03:20 · 122 阅读 · 0 评论 -
C++组合类
#include<iostream>#include<cmath>using namespace std;class A { public: A(int xx=0,int yy=0){x=xx;y=yy;cout<<"A_init1"<<endl;} A(A &a){x=a.x;y=a.y;cout<<"A_init2"<<endl;} int getx(){return x;}原创 2020-11-05 09:02:00 · 312 阅读 · 0 评论 -
C++析构函数
#include"iostream"/**************************析构函数在对象被删除前一刻被调用无返回值,不接受任何参数 ****************************/using namespace std;class point { public: point(int xx,int yy) {原创 2020-11-05 09:01:27 · 96 阅读 · 0 评论 -
C++前向引用声明
#include<iostream>#include<cmath>using namespace std;class A; class B;//前向引用声明 class A { public: A(int xx=0,int yy=0){x=xx;y=yy;cout<<"A_init1"<<endl;} A(A &a){x=a.x;y=a.y;cout<<"A_init2"<<endl;}原创 2020-11-05 08:53:39 · 644 阅读 · 0 评论 -
C++构造函数
C++构造函数#include<iostream>/********************************** 构造函数在创建对象时被调用 ***********************************/ using namespace std;class point { public: point(int xx,int yy) /原创 2020-11-05 08:52:57 · 129 阅读 · 0 评论