提供函数的标题

Gun*_*n64 -2 c++ arrays header function

这是一个简单的家庭作业问题,我不太了解.也许你们可以帮助这个,所以我可以得到其他人.

对于下面部分填充的整数数组的操作,提供函数的标题(除了正文之外的所有内容).不要实现这些功能.

一个.按降序排列元素.

它想要某种for循环吗?多谢你们!

das*_*ght 8

它想要某种for循环吗?

赋值说你不应该实现你的函数,所以不,他们不想看到循环.他们想要的只是功能的"签名" - 详细说明以下三件事:

  • 功能的名称
  • 函数返回的值的类型(如果有的话; void用于"无返回值")
  • 函数所采用的参数的类型和顺序(如果有).

函数头的语法如下:

float compute ( int, double );
^^^^^ ^^^^^^^ ^ ^^^  ^^^^^^ ^
  |      |    |  |      |   |
  |      |    |  |      |   +- Closing parenthesis (required)
  |      |    |  |      +----- Type of the second argument
  |      |    |  +------------ Type of the first argument
  |      |    +--------------- Opening parenthesis (required)
  |      +-------------------- Function name (must start in a letter)
  +--------------------------- Function's return type
Run Code Online (Sandbox Code Playgroud)

注意:这是一个示例,而不是您的作业的答案.

  • 我认为`float compute(int,double)`旨在成为他们所寻找的示例,而不是具体的解决方案.`compute`将是排序函数的奇怪名称. (3认同)