【问题标题】:Parameter name omitted error?参数名称省略错误?
【发布时间】:2012-10-18 08:53:04
【问题描述】:

尝试调用该方法时出现错误:

int box(int rows, int cols, int [rows][cols])

来自使用此调用的主方法:

box(arrayDimensions, arrayDimensions, array);

但我不确定问题是什么。

谢谢。

【问题讨论】:

  • 您遇到什么错误?您能否向我们展示您可以尝试的代码片段?另外,int [rows][cols] 是什么?
  • 或许int box(int rows, int cols, int ARRAY[rows][cols])?
  • @JosephQuinsey 我本来打算和YourArrayVariableNameGoesHere一起去的,但喊出来似乎是正义的=P

标签: c arrays function methods


【解决方案1】:
int box(int rows, int cols, int [rows][cols])

需要

int box(int rows, int cols, int something[rows][cols])

【讨论】:

    【解决方案2】:

    请记住,您在函数定义/标头中使用的每个变量都需要有一个标识符/名称。像其他任何东西一样,您使用的数组需要有一个标识符/名称,因为它是一个变量@AkshaiShah 很好地修改了您的代码。

    【讨论】:

      猜你喜欢
      • 2013-10-06
      • 2017-10-28
      • 2012-02-05
      • 1970-01-01
      • 1970-01-01
      • 2021-10-24
      • 1970-01-01
      • 2011-06-27
      • 2021-12-09
      相关资源
      最近更新 更多