
C++基础
cloud-2014
这个作者很懒,什么都没留下…
展开
-
C++基础学习(七),多态
#include <iostream>using namespace std;class Fish{public: void swim() { cout<<"Fish swim..."<<endl; }};class Tuna : public Fish{public: void swim() { cout<<...原创 2018-05-19 11:37:11 · 220 阅读 · 0 评论 -
C++基础学习(六),继承
#include <iostream>#include <string>using namespace std;class Fish{public: void Swim() { if (m_bFreshWaterFish) { cout<<"swims in lake"<<endl; } else { ...原创 2018-05-16 22:00:11 · 748 阅读 · 0 评论 -
C++基础学习(五),拷贝构造函数
拷贝构造函数详解原创 2018-05-16 20:45:23 · 199 阅读 · 0 评论 -
C++基础学习(四),友元函数和友元类
#include <iostream>#include <string>using namespace std;//使用friend关键字让外部函数DisplayAge()能够访问私有数据成员class Humen{public: Humen(string name, int age) :m_strName(name), m_nAge(age) {...原创 2018-05-16 20:33:19 · 160 阅读 · 0 评论 -
C++基础学习(十),智能指针
C++智能指针简单剖析:https://www.cnblogs.com/lanxuezaipiao/p/4132096.htmlC++ 智能指针详解:https://blog.youkuaiyun.com/xt_xiaotian/article/details/5714477C++智能指针梳理:https://blog.youkuaiyun.com/shuishanga/article/details/52982102...原创 2018-05-19 18:24:25 · 185 阅读 · 0 评论 -
C++基础学习(九),类型转换运算符
#include <iostream>using namespace std;class Fish{public: virtual void swim() { cout<<"Fish swims in water"<<endl; } virtual ~Fish(){}};class Tuna : public Fish{pu...原创 2018-05-19 17:08:07 · 200 阅读 · 0 评论 -
C++基础学习(八),运算符类型和运算符重载
#include <iostream>using namespace std;class Date{public: Date(int year, int month, int day) :m_nYear(year), m_nMonth(month), m_nDay(day) { } Date& operator ++() { ++m_nDay...原创 2018-05-19 16:35:45 · 255 阅读 · 0 评论 -
C++基础学习(三),指针和引用
#include <iostream>#include <string>using namespace std;//C++的const指针用法int main(){ //const修饰指针有三种方式: int x = 12; int y = 34; //1,p1可以指向不同的内存地址,但是不能通过p1修改内存地址所指向的数据 const int *...原创 2018-05-13 18:37:13 · 260 阅读 · 0 评论 -
C++基础学习(二),字符串
C风格字符串:原创 2018-05-13 17:08:14 · 166 阅读 · 0 评论 -
C++基础学习(一),常量的定义和使用
#include <iostream>using namespace std;//表示方位的枚举常量enum CardinalDirections{ North = 12, South,//13 East,//14 West//15};//枚举常量测试int main(){ CardinalDirections direct = East; cout&...原创 2018-05-13 16:33:56 · 247 阅读 · 0 评论 -
extern "C" 用法解析
https://blog.youkuaiyun.com/qq_33724710/article/details/51469653转载 2018-07-31 15:28:54 · 238 阅读 · 0 评论