随笔分类 - C/C++
摘要:C++中的多态(关于虚...) 1.前置基础知识 1.1对象是如何存储在内存中的 #include <iostream> #include <string> class Animal { private: string name; int age; public: Animal(std::strin
阅读全文
摘要:
在学习中发现对const在限定函数的作用有些模糊,以下为笔者的学习总结 1.5cv限定符及一些关键字在限定函数的作用 c(const)v(volatile) const:用于表示该函数不会改变类的成员变量,所以是可以修改全局变量的 volatile:用于告诉编译器该对象可能会被程序外部修改 #inc
阅读全文
