c++基础
伟大的小西西
这个作者很懒,什么都没留下…
展开
-
构造函数与析构函数
Test t3 //调用类的无参数构造函数//显示提供一个有参的构造方法,默认的构造函数不复存在Test(int x, int y){ m_x = x; m_y = y}原创 2018-12-05 11:49:32 · 136 阅读 · 0 评论 -
类的基本使用方法
#define _CRT_SECURE_NO_WARNINGS #include <iostream>using namespace std;struct Hero{ char name[64]; int sex;};void printHero(struct Hero &h){ cout << "name=" <&l...原创 2018-12-02 14:01:43 · 1149 阅读 · 0 评论 -
友元
#define _CRT_SECURE_NO_WARNINGS #include <iostream>#include <string>using namespace std;class Building{ //让全局的好基友函数变为好朋友 friend void goodGay(Building * building);public:...转载 2018-12-27 10:48:45 · 163 阅读 · 0 评论