代码之家  ›  专栏  ›  技术社区  ›  Rich Bradshaw

函数第一行的名称是什么?

  •  3
  • Rich Bradshaw  · 技术社区  · 15 年前

    我在写一个工作表,想让学生写一个如下的函数:

    isPrime(int number)
    

    那句话叫什么?我想到了清单,但我不认为是这样…

    4 回复  |  直到 15 年前
        1
  •  7
  •   Kornel Kisielewicz    15 年前

    可以被调用 header , declaration signature .

    第一个与“函数声明”、“函数头”、“函数体”匹配良好。

        2
  •  4
  •   Prasoon Saurav    15 年前

    function prototype ,请 declaration signature

        3
  •  4
  •   Dario    15 年前

    如果你写

    bool isPrime(int);
    

    你称之为 宣言 反之

    bool isPrime(int number) { /* code */ }
    

    是实际的 定义 . (c此处允许明确区分)

    通常,您的表达式称为(类型) 签名 函数的

        4
  •  -1
  •   helpermethod    15 年前

    签名==名称、参数个数、参数类型,但不是返回类型,而声明==签名+返回类型