#include "stdafx.h" #include <iostream>
#include <string>
using namespace std; //自己实现委托
class A {
public:
void Func(int i) { printf("afff%d\n",i); }
}; void (A::*pFunc)(int) = &A::Func; char (*pFun)(int) ;
char glFun(int a){ return 'a';} int _tmain(int argc, _TCHAR* argv[])
{
//A a;
//A* pa = &a;
//(pa->*pFunc)(11); pFun = glFun;
(*pFun)();
return ;
}
相关文章
- 自己实现so加载器
- Spring实现定时任务(@Scheduled注解)
- pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试
- css2.1实现圆角边框
- Effective C++条款05:了解C++默默编写并调用哪些函数
- 第四篇:了解 C++ 默默编写并调用的函数
- WPF实现数据库操作与日志记录
- C++中malloc / free 和 new / delete 的区别?
- 在EF中使用Expression自动生成p=>new Entity(){X="",Y="",..}格式的Lambda表达式灵活实现按需更新
- jQuery实现的浮动层div浏览器居中显示效果