声明并初始化函数指针数组 [英] Declaring and initializing array of function pointers

查看:78
本文介绍了声明并初始化函数指针数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问如何在C ++中声明函数指针数组以及如何初始化它们。

解决方案

尝试阅读本文,



http://social.msdn.microsoft.com/Forums/vstudio/en-US/c3791384-6b36-47d4-942e-29636add451c/initializing-an-array-of-pointers-to-functions [ ^ ]



希望它有所帮助。


函数指针及其初始化的一个示例是:

  typedef   void (CALLBACK * THREADPOOLCALLBACK)(PVOID);  //  函数指针 

void CALLBACK foo(PVOID param) // function
{
// ...
}

THREADPOOLCALLBACK tpc = FOO;


Please how are array of function pointers declared in C++ and how are they initialized.

解决方案

Try to read this,

http://social.msdn.microsoft.com/Forums/vstudio/en-US/c3791384-6b36-47d4-942e-29636add451c/initializing-an-array-of-pointers-to-functions[^]

Hope it helps.


An example of a function pointer and its initialization is:

typedef void (CALLBACK* THREADPOOLCALLBACK)(PVOID);  // function pointer

void CALLBACK foo(PVOID param)  // function
{
  // ...
}

THREADPOOLCALLBACK tpc = foo;


这篇关于声明并初始化函数指针数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆