随笔分类 -  C++基础知识

摘要:http://c.biancheng.net/view/218.html 阅读全文
posted @ 2021-06-06 15:23 renhl 阅读(25) 评论(0) 推荐(0)
摘要:http://c.biancheng.net/view/7909.html 阅读全文
posted @ 2021-06-01 08:51 renhl 阅读(21) 评论(0) 推荐(0)
摘要:lambda 源自希腊字母表中第 11 位的 λ,在计算机科学领域,它则是被用来表示一种匿名函数。所谓匿名函数,简单地理解就是没有名称的函数,又常被称为 lambda 函数或者 lambda 表达式。 lambda匿名函数的定义 定义一个 lambda 匿名函数很简单,可以套用如下的语法格式: [外 阅读全文
posted @ 2021-05-17 08:36 renhl
摘要:两种场合:1. 父类指针转换为子类指针转换失败返回空;成功返回子类指针2. 父类引用转换为子类失败抛出bad_cast异常; 成功返回子类的引用#include using namespace std; class CBasic { public: virtual int test(... 阅读全文
posted @ 2014-07-18 08:46 renhl 阅读(240) 评论(0) 推荐(0)
摘要:总共有6个。构造、拷贝构造、析构函数 赋值运算、取址、取址consthttp://blog.sina.com.cn/s/blog_5f76aaf20100cwlj.html 1 class Empty 2 { 3 public: 4 Empty(); // 缺省构造函数 5 Empty( const Empty& ); // 拷贝构造函数 6 ~Empty(); // 析构函数 7 Empty& operator=( const Empty& ); // 赋值运算符 8 Empty* operator&(); // 取址运算符 9 const Empty* op 阅读全文
posted @ 2013-07-09 20:04 renhl 阅读(167) 评论(0) 推荐(0)