自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 c++static关键字

#include using namespace std;class A{    static int i;public:    static int j;    static void set_i(int a){  //用静态方法访问静态属性        i = a;    }    void print()    {   

2017-07-28 15:21:46 180

原创 c++const关键字

#include using namespace std;class A{public:    const int i;    int j;    A(int m):i(m){  //必须通过参数列表对const修饰的对象进行初始化    }    ~A(){    }    void set_j(int n){ 

2017-07-28 15:20:57 283

原创 c++浅复制

#include #include using namespace std;class A{public:    char *p;    A(char *src){        p = new char[128];          //在堆区开辟了新空间,然后复制构造器没有重写,复制的对象与被复制的对象同时指向堆区同一片空间,为浅复制        st

2017-07-28 15:19:27 154

原创 c++深复制

#include #include using namespace std;class A{public:    char *p;    A(char *src){        p = new char[128];        strcpy(p,src);    }    A(A &a){            //重写复制构造器,为通过

2017-07-28 15:18:57 188

原创 +,++运算符重载

#include using namespace std;class A{    int i;    int j;public:    A(int m = 0,int n= 0):i(m),j(n){    }    ~A(){    }    A operator++()    {        ++(this->i

2017-07-28 15:17:30 165

原创 逻辑与和逻辑或运算符重载

#include using namespace std;class A{public:    int i;    A(int m = 0):i(m){    }    A operator++(){        cout        ++(this->i);        return *this;    }     A

2017-07-28 15:16:04 361

原创 输入输出运算符重载

#include using namespace std;class A{public:    int i;    int j;    A(int m, int n):i(m),j(n){    }    ~A(){    }};ostream&  operator{    os     return os;

2017-07-28 15:15:05 201

原创 new,delete运算符重载

#include #include using namespace std;class A{    int i;    int j;public:    A(){        cout     }    void *operator new(size_t size)    {        void *p;        p =

2017-07-28 15:12:52 349

原创 c++多态,子类和父类方法的调用

#include using namespace std;class A{public:    void run(){        cout     }    virtual void run0(){        cout     }    A(){        cout     }    virtual ~

2017-07-28 15:05:42 4044

原创 c++ string类构造器重写和运算符重载代码

#include #include #include using namespace std;class Mstring{public:    char *p;    Mstring();    Mstring(char *q);    ~Mstring();    Mstring(const Mstring &mstr);    Mst

2017-07-27 18:16:47 305

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除