Why use function prototypes?

前端 未结 3 1889
慢半拍i
慢半拍i 2021-02-07 13:48

Why use function prototypes in C? It seems sort of redundant because we already declare the function name, argument types, and return type in the definition. Do the prototypes h

3条回答
  •  无人及你
    2021-02-07 14:24

    While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.

    Creating library interfaces: By placing function prototypes in a header file, one can specify an interface for a library.

提交回复
热议问题