cpp class property mass

friend istream& operator>>(istream  &input,Complex &a){
        input>>a.real>>a.imaginary;
        return input;
    };
    friend ostream& operator<<(ostream &output,const Complex &a){
    output<<a.real<<'+'<<a.imaginary<<'i'<<endl;
    return output; 
    };

抽象类:有纯虚函数(必须重载
vtable:https://blog.youkuaiyun.com/primeprime/article/details/80776625

虚析构是为了调用子类的防止释放不完整

typeinfo typeid()
https://blog.youkuaiyun.com/w55100/article/details/80330812

static

static data member can be change by all way except const function.
static function only use static member

construct and de order

instance derive class use base constructor to initialize the base member
Base class constructors and assignment operators

class A{
B b;
C c;
}

con:b,c,a

de a,c,b

initialize list

class A{
const a;
A(int 1):a=i    //can change const
{
}
}

动态链接就是编译到时候不知道,执行的时候才知道连接
https://blog.youkuaiyun.com/lz20120808/article/details/50461296

array

array1=array2 //no 
array1==array2 //no

nochar array can’t be io at once

class_copy

’ =’ use copy constructor.

have default if you don’t create one,(default is shallow copy).

only one argument and it must be reference or infinite recursion.

prevent copy :
https://blog.youkuaiyun.com/weixin_42183514/article/details/83661208

cast operator functions
https://blog.youkuaiyun.com/qq_39025293/article/details/104435854
https://blog.youkuaiyun.com/michaelalan/article/details/16973925

inheritance

operator can be inherited
https://www.cnblogs.com/wkfvawl/p/10738409.html

"using " in inheritance
By default, each inherited constructor has the same access level (public, protected or private) as its corresponding base-class constructor.
d.If the derived class does not explicitly define constructors, the compiler generates a default constructor in the derived class—even if it inherits other constructors from its base class.
https://www.cnblogs.com/sssblog/p/10202601.html

Theoretically, clients do not need to see the source code of classes from which they derive other classes.
在这里插入图片描述derived class vtable would not similar to base class, will receive a pointer to the virtual function of base class

The C++ compiler makes objects take up more space in memory if they have virtual function

using

https://www.cnblogs.com/wkfvawl/p/10738409.html

explicit constructor

exactly one argument
can’t type conversion

other

*(this).=this->

Run-time type information can be used to determine object type.

only my personally daily, maybe somethings is wrong

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值