摘要:
面向对象 简单的说就是写很多类 每个类有自己的数据和函数,叫做“成员”。 类定义出来的变量,也称为类的实例,就是“对象”。 和struct 好像差不多 对象之间有 '=' 关系,其他的需要定义 private: 私有成员,只能在成员函数内访问public: 公有成员,可以在任何地方访问protect 阅读全文
摘要:
c++/oop 引用 就相当于是原变量 int & a = b 相当于是别名 一个神奇的写法:引用作为函数返回值 1 int n = 4; 2 int & SetValue() { 3 return n; 4 } 5 int main() { 6 SetValue() = 40; 7 cout << 阅读全文
摘要:
CS61A pyhton 高阶函数 A function that either: Takes another function as an argument Returns a function as its result All other functions are considered fi 阅读全文