摘要:
C 模拟 C++ 的多态特性(指向派生类的基类指针在调用虚函数时是派生类重写的函数) 利用的是函数指针,因为 C 的 struct 是不能有函数的(C++ 的struct可以) #include<iostream> using namespace std; struct A{ virtual voi 阅读全文
摘要:
ubuntu18(g++、gdb) #include<iostream> #include<stdio.h> using namespace std; int main(){ int x = 1; int y = 2; int &b = x; return 0; } 编译带参数 -g gdb ./程 阅读全文