摘要:
类和类之间的关系 Object Oriented Programming Object Oriented Design 面向对象的思想:类与类之间产生关系 关系: Inheritance -> 继承 Composition -> 复合 Delegation -> 委托 -> Composition 阅读全文
posted @ 2024-03-30 15:31
俊king
阅读(19)
评论(0)
推荐(0)
摘要:
类模板、函数模板、其他 static 示例代码: #ifndef __COMPLEX__#define __COMPLEX__class complex{ // 成员函数的隐藏参数有this -> 形参不能写.返回值当中可以写可以不写 public: double real() const { r 阅读全文
posted @ 2024-03-30 15:29
俊king
阅读(9)
评论(0)
推荐(0)
摘要:
类定义(class definition) class以外的函数 存在的一定是函数 如果是class的函数,那么一定带有类名::function 要么就是全局函数,函数名称不会带有class_name_function_name 非成员函数(无this) 示例代码: inline complexop 阅读全文
posted @ 2024-03-30 01:31
俊king
阅读(91)
评论(0)
推荐(0)

浙公网安备 33010602011771号