随笔分类 - c++
摘要:内存对齐 先看一下c++结构体 struct Son { int age; int money; void run() { cout << "Person::runm()" << age << endl; } }; int main() { Son son; cout << sizeof(son)
阅读全文
摘要:struct和class区别 //默认成员权限是private class Person { //private: int age; void run() { cout << "Person::runm()" << endl; } }; //默认成员权限是public struct Son { //
阅读全文
摘要:int a = 1; int & const p = a; //实际上这里的p和指针类似,特性和指针差不多
阅读全文