函数指针
来源:互联网 发布:优化csgo的显卡驱动 编辑:程序博客网 时间:2024/06/15 22:52
--- d:\vs2015\acode\genlist\genlist\main.cpp -----------------------------------int main(){008D1800 push ebp 008D1801 mov ebp,esp 008D1803 sub esp,0C0h 008D1809 push ebx 008D180A push esi 008D180B push edi 008D180C lea edi,[ebp-0C0h] 008D1812 mov ecx,30h 008D1817 mov eax,0CCCCCCCCh 008D181C rep stos dword ptr es:[edi] Func1 = Func2;008D181E mov dword ptr [Func1 (08D8138h)],offset Func2 (08D101Eh) //Func2(); //(*Func1)(); printf("%x\n", (*Func1));008D1828 mov eax,dword ptr [Func1 (08D8138h)] 008D182D push eax 008D182E push offset string "%x\n" (08D6B40h) 008D1833 call _printf (08D131Bh) 008D1838 add esp,8 printf("%x\n", Func2);008D183B push offset Func2 (08D101Eh) 008D1840 push offset string "%x\n" (08D6B40h) 008D1845 call _printf (08D131Bh) 008D184A add esp,8 return 0;008D184D xor eax,eax }008D184F pop edi 008D1850 pop esi 008D1851 pop ebx 008D1852 add esp,0C0h 008D1858 cmp ebp,esp 008D185A call __RTC_CheckEsp (08D1113h) 008D185F mov esp,ebp 008D1861 pop ebp 008D1862 ret --- 无源文件 -----------------------------------------------------------------------
</pre><pre class="cpp" name="code">#include <stdio.h>typedef int(*MyFunc)();MyFunc Func1;int Func2(){ printf("#########\n"); return 0;}int main(){ Func1 = Func2; //Func2(); //(*Func1)(); printf("%x\n", (*Func1)); printf("%x\n", Func2); return 0;}
0 0
- 指针函数 函数指针
- 函数指针/指针函数
- 指针函数&函数指针
- 函数指针 指针函数
- 函数指针 指针函数
- 指针函数,函数指针
- 函数指针,指针函数,
- 指针函数,函数指针
- 函数指针 指针函数
- 函数指针、指针函数
- 指针函数&函数指针
- 函数指针 指针函数
- 函数指针 指针函数
- 函数指针&指针函数
- 指针函数 函数指针
- 指针函数 &函数指针
- 函数指针&指针函数
- void指针 函数指针
- ListView控件中item中实现的Button的点击事件
- HTML5 User Interaction(描述页面内容交互工作的新方式)
- 前端小特效
- 分布式与集群的区别
- haproxy安装配置
- 函数指针
- leetcode——Kth Largest Element in an Array
- Android打造通用标题栏——让你的App统一标题栏风格
- mfc 对话框 listbox control
- 过客--茫然了,梳理一下20160911
- hdu5875(思维题)
- Volley框架你想知道的秘密
- 使用rxjava实现imager loader,自定义缓存规则,
- bootstrap 的全屏轮播