摘要: 左值 左值:一个表示数据的表达式(如变量名或者解除引用的指针),程序可从堆栈上获取其地址。最初,左值可出现在赋值语句的左边,但是在有了const修饰符后,可以声明一个没有赋值的标识符并获取其地址。 //左值的例子 int n; int *pt = new int; const int b = 101 阅读全文
posted @ 2022-03-06 17:03 fwx 阅读(59) 评论(0) 推荐(0)
摘要: virtual 对于虚方法(virtual method),如果一个方法是通过引用或者指针而不是对象调用的,它将确定使用哪一种方法。如果没有使用关键字virtual,程序将根据引用类型或指针类型选择方法;如果使用了virtual,程序将根据引用或指针指向的对象的类型来选择方法。 基类通常声明虚析构函 阅读全文
posted @ 2022-03-04 13:49 fwx 阅读(53) 评论(0) 推荐(0)
摘要: 隐式类型转换 Implicit conversion Standard conversions affect fundamental data types, and allow conversions such as the conversions between **1)numerical typ 阅读全文
posted @ 2022-03-04 09:36 fwx 阅读(32) 评论(0) 推荐(0)
摘要: Exceptions provide a way to react to exceptional circumstances (like runtime errors) in programs by transferring control to special functions called h 阅读全文
posted @ 2022-03-04 00:00 fwx 阅读(130) 评论(0) 推荐(0)
摘要: 之前学习锁,用到了lock_guard,让我想起了自己智能指针部分还有所欠缺,故借机学习一波 **智能指针:**一个对于指针的封装,目的在于更好的管理内存,防止指针使用中的内存泄漏、二次释放等问题的产生。在C++的<memory>库中,有以下几种指针:auto_ptr、auto_ptr_ref、sh 阅读全文
posted @ 2022-03-02 23:12 fwx 阅读(104) 评论(0) 推荐(0)