c++ - 函数的复杂参数

标签 c++ function pointers function-pointers

我的任务是创建带有四个参数的函数 funCall :

  • 存储数字对的二维整数数组的指针
  • 变量 int 维护二维数组中数字的数量
  • 指向函数指针表的指针
  • int 变量存储有关函数指针数量的信息

我在想这样的事情:

typedef int(*funPtr)(int, int);
funPtr arrayOfFuncPtrs[];

void funCall( *int[][]k, int a, *funPtr z, int b);
{
}

最佳答案

typedef int(*funPtr)(int, int);

void funCall( int** array_2d, int num_of_nums, funPtr* fn_ptr_array, num_of_fn_ptrs)
{
}

像这样吗?

关于c++ - 函数的复杂参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2717046/

相关文章:

sql - 带参数的内连接函数

c - 添加一行代码改变变量的内存地址

C++ vector 不保留从循环接收的值

c++ - 从 std::heap 中间移除一个元素

algorithm - 在 int 中找到第 n 个 SET 位

c - 如果 argv[] 是一个指针数组,那么 printf ("%s", argv[]) 如何工作?

ios - 函数调用后指针改变

c++ - 尝试链接 boost::filesystem 以调试 MSVC11 项目时出现链接器错误

c++ - 位掩码 : Initialize an int bitmask with a variable length list of ints AND int-ranges

c - 指向函数的指针