打印虚函数地址
来源:互联网 发布:三毛真相知乎 编辑:程序博客网 时间:2024/05/16 04:45
#include <iostream.h>
class M
{
public:
virtual void f1(){cout<<"f1()"<<endl;}
virtual void f2(){cout<<"f2()"<<endl;}
virtual void f3(){cout<<"f3()"<<endl;}
virtual void f4(){cout<<"f4()"<<endl;}
virtual void f5(){cout<<"f5()"<<endl;}
virtual void f6(){cout<<"f6()"<<endl;}
virtual void f7(){cout<<"f7()"<<endl;}
virtual void f8(){cout<<"f8()"<<endl;}
};
void showvpt(int* p);
int main(){
M m;
showvpt((int*)(&m));
return 0;
}
void showvpt(int* p){
int* pv;
if(!*p){
cout<<"*p is NULL"<<endl;
return;
}
pv=(int*)(*p);
while(*pv){
cout<<pv<<"----------"<<*pv<<endl;
pv++;
}
}
class M
{
public:
virtual void f1(){cout<<"f1()"<<endl;}
virtual void f2(){cout<<"f2()"<<endl;}
virtual void f3(){cout<<"f3()"<<endl;}
virtual void f4(){cout<<"f4()"<<endl;}
virtual void f5(){cout<<"f5()"<<endl;}
virtual void f6(){cout<<"f6()"<<endl;}
virtual void f7(){cout<<"f7()"<<endl;}
virtual void f8(){cout<<"f8()"<<endl;}
};
void showvpt(int* p);
int main(){
M m;
showvpt((int*)(&m));
return 0;
}
void showvpt(int* p){
int* pv;
if(!*p){
cout<<"*p is NULL"<<endl;
return;
}
pv=(int*)(*p);
while(*pv){
cout<<pv<<"----------"<<*pv<<endl;
pv++;
}
}
- 打印虚函数地址
- 打印虚函数地址的方法
- 打印函数地址
- [C++] 虚指针,虚表,虚函数地址打印
- 打印成员函数地址一例
- 如何打印类成员函数的地址
- (ZT) cout打印不了函数地址
- C++学习笔记之:虚函数之虚表地址打印方法
- PHP 打印调用函数入口地址(堆栈),方便调式
- 虚函数地址表
- 虚函数表的打印
- 变量地址打印保存
- C地址打印
- 如何打印内存地址
- 打印内存地址
- C++打印地址
- rust:打印变量地址
- 打印mac地址
- struts2 namespace算法实现
- PKU 2376 Cleaning Shifts
- ubuntu8.04关于公共环境变量的设置
- LabVIEW 实现窗口置顶与透明显示
- Java 获取系统信息及Desktop类
- 打印虚函数地址
- BASIS标准手册
- C++ Primer 关于while(cin>>word) 退出循环问题
- 2008校园消防安全周系列活动策划
- 我的新站Netstroll网,www.netstroll.cn
- GROUPING SETS 学习
- 底层编程 - 检测鼠标
- 保护你的DLL和Code不被别人使用
- 批处理之循环