如何记忆c++关键字

数据类型相关

常数:true, false

基本数据类型:bool, char, double, float, int
修饰/基本数据类型:long (long int), short (short int)
修饰基本类型: signed, unsigned

自定义数据类型:union, struct, class, enum, void
超集/泛化/别名:(namespace, using) / (template, typename) / typedef

存储类型:auto, register (C++11之后被删除,c++20之后是编译错误), extern, static, mutable

类型转换:const_cast, dynamic_cast, reinterpret_cast, static_cast, explicit

约束类型:const, volatile

运算符号
可重载运算符:

不可重载运算符:
. .* :: ?= # sizeof

过程控制

条件:if, else, switch, case, default,
循环:do, for, while, continue, break
跳转:goto

函数(函数类型、函数名、型式参数和函数体)

函数类型: inline
函数名:operator
函数体:return
基本操作符(和+、-、*、/一样,也可以理解为基本函数,即不需要声明,也不需要任何头文件): sizeof, new, delete, typeid (教材中未明确定义)

面向对象编程相关(抽象、封装、继承、多态)
抽象:friend
封装和继承:private, public, protected
多态: virtual

其他
异常处理:try, catch, throw

指针和地址
指针: this

posted @ 2022-11-14 18:07  ChrainY  阅读(83)  评论(0编辑  收藏  举报