Articles
165
Tags
0
Categories
19
首页
归档
标签
分类
友链
李瑞琦的博客
05 继承及多态
首页
归档
标签
分类
友链
05 继承及多态
Created
2024-06-02
|
03-C++
|
Post Views:
Author:
Li Ruiqi
Link:
https://li-ruiqi777.github.io/03-C++/05-继承及多态.html
Copyright Notice:
All articles on this blog are licensed under
CC BY-NC-SA 4.0
unless otherwise stated.
Previous
04 构造函数
构造函数分类 C++中有一下几类构造函数 以一下这个类为例: 1234class Person{ int age; std::string name;}; 1.默认构造函数没有参数,用于创建一个具有默认值的Person对象。 1Person()=default; 2.参数化构造函数1Person(int a, std::string n) : age(a), name(n) {} 3.拷贝构造函数使用另一个对象来初始化当前对象。 1Person(const Person& other) : age(other.age), name(other.name)...
Next
03 命名空间
命名空间1.C++的作用域C++中有四种作用域,在不同的作用域中可以定义名字相同的变量,互不干扰。 命名空间作用域:就是程序员利用名字空间定义在C++程序中划分出来的一块比较大的程序区段。在该程序区段内部,可以定义变量、函数、类、typedef、#define 等,最后由{...
Li Ruiqi
总有低谷
Articles
165
Tags
0
Categories
19
Follow Me
Recent Posts
26 PCIE
2026-04-17
claudecode
2026-04-15
autoconf
2026-03-21
git
2026-02-10
25 IIO子系统
2026-01-27