【问题标题】:complex arguments for function函数的复杂参数
【发布时间】:2010-04-26 21:31:09
【问题描述】:

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

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

我在想这样的事情:

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

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

【问题讨论】:

  • 你的问题是......
  • 我不认为funPtr 在复平面上取“整数”。
  • 你想做什么?这可能会告知您如何布置代码和数据结构。

标签: c++ function pointers function-pointers


【解决方案1】:
typedef int(*funPtr)(int, int);

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

喜欢这样吗?

【讨论】:

  • int array_2d[][2] 会更好。
猜你喜欢
  • 2014-08-28
  • 2021-06-10
  • 2015-03-05
  • 1970-01-01
  • 2019-01-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多