惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
博客园_首页
T
Tailwind CSS Blog
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
S
SegmentFault 最新的问题
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium
Jina AI
Jina AI
WordPress大学
WordPress大学
U
Unit 42
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog

博客园 - 能巴

[SQL Server]Index/deadlock 业务学习 [LoadRunner]负载测试工具 一般函数指针和类的成员函数指针 [P4 password]Avoiding the Perforce Prompt for Password in Windows [收藏转载]2011 APP年终总结——日均160元的收入经历 [收藏转载]我所积累的20条编程经验 [收藏转载]明星软件工程师的十种特质 Importance of Side Projects [转载]最好的HTML 5编码教程和参考手册分享 . [Mobility]移动开发概览 How Browser Works [c++ 11x rvalue reference] [转载]The Biggest Changes in C++11 (and Why You Should Care) Summary of Exception Exception Cost STL算法find_if和find QT信号和槽 How to set NoStepInto for VS debugging
Review: Function Pointer
能巴 · 2011-07-01 · via 博客园 - 能巴

Two ways to make use of it:
1) directly declare a function pointer variable at the place where it's required. like below:
void (*pFunc)(int); // pFunc is a variable here
pFunc = &FuncA;
pFunc(2);
2) typedef a function poiner type and then use it. like below:
typedef void (*pFunc)(int);
pFunc pFuncObj = &FuncA;
pFuncObj(2);