摘要:
#include#includeusing namespace std;/* 4.1 封装 成员属性设置为私有的优点: 可以自己控制读写权限 对于写权限,可以检测数据有效性*/class Pers... 阅读全文
posted @ 2021-03-14 18:30
yub4by
阅读(48)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;/* 4.1 封装 访问权限: 公共 public 其中的成员在类内+类外均可访问 保护 protected ... 阅读全文
posted @ 2021-03-14 18:29
yub4by
阅读(52)
评论(0)
推荐(0)
摘要:
#include#includeusing namespace std;#define PI 3.14/* 4.1 封装 C++面向对象三大特性:封装、继承、多态 封装意义: 设计类时可以将属性和行为作为... 阅读全文
posted @ 2021-03-14 18:27
yub4by
阅读(62)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;/* 三 函数提高 3.3 函数重载 函数名可以相同以提高复用性 函数重载需满足的条件: 同意作用域下 函数名相同 ... 阅读全文
posted @ 2021-03-14 15:20
yub4by
阅读(31)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;/* 三 函数提高 3.2 函数占位参数 当前学习阶段,占位参数传入后,也接收不到;现在用不到,后续课程用到*/void func(int a, int){ // 第二个int即为占位参... 阅读全文
posted @ 2021-03-14 15:19
yub4by
阅读(56)
评论(0)
推荐(0)
摘要:
#includeusing namespace std;/* 三 函数提高 3.1 函数默认参数*/// 注意,若某个位置已有了默认参数,则从该参数位置往后的每个参数都必须有默认值,例func(int a, int b, int c=30, d=4... 阅读全文
posted @ 2021-03-14 15:18
yub4by
阅读(22)
评论(0)
推荐(0)

浙公网安备 33010602011771号