![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
About_C++
ironcarrot
这个作者很懒,什么都没留下…
展开
-
【C++ Primer】1.5类简介上Sales_item.h
P18输入:0-201-70353-X 4 24.99输出:0-201-70353-X 4 99.96 24.99代码:#ifndef SALESITEM_H#define SALESITEM_H#include #include #include #include #include "Sales_item.h"class Sales_item原创 2017-01-13 10:25:28 · 375 阅读 · 0 评论 -
【C++Primer】构造函数_初始化列表编码
啊!又是让人崩溃的一天!简直完美到原地爆炸!#include #include #include #include "Teacher.h"using namespace std;class Teacher{public: Teacher(string name="Jim",int age=2,int m=100); void setName(string name); st原创 2017-01-30 16:28:35 · 302 阅读 · 0 评论 -
【C++】封装_构造函数
这个东西整得我很头疼啊。。。#include #include #include #include "Teacher.h"using namespace std;class Teacher{public: Teacher(); Teacher(string name,int age=20); void setName(string name); strin原创 2017-01-30 15:30:00 · 435 阅读 · 0 评论 -
【C++Primer】封装_拷贝构造函数
噫,大概有些了解构造函数了,这大概是一下午反复折腾收到的最好回报了。#include #include #include #include "Teacher.h"using namespace std;class Teacher{public: Teacher(string name="Ludwing",int age=26); Teacher(const Teach原创 2017-01-30 16:48:02 · 344 阅读 · 0 评论 -
【C++_STL_next_permutation】全排列讲解
关于next_permutation,这是一个求排列的函数,仅仅只知道它是一个求排列的函数是不够的,我们需要知道它的工作原理。next_permutation属于C++里面的STL的内容。可以参考这个全排列的资料:1.https://zhidao.baidu.com/question/2012821195157864068.html2.http://blog.csdn.net/原创 2016-12-25 15:14:55 · 553 阅读 · 0 评论 -
【C++】简述基类和派生类中数据成员间的关系
首先,在进行一个工程构建的时候,不能为了方便而把所有基类数据成员设置为公有。在调用过程中,基类中私有类型的数据成员不能在派生类中直接调用,需要用到一个get()形式的访问函数才能在子类中访问对应的基类数据成员。class Coordinate{ public: int getx(); private: int x; };int Coordinate::getx(){原创 2017-06-07 11:20:24 · 1662 阅读 · 0 评论