Function Declarations and Prototypes
A prototype tells the compiler a function's name, return type and parameter types before it is used.
Beginner
float average(const float *v, size_t n); — put prototypes in headers. In C before C23, int f(); means "unspecified parameters" — write int f(void);.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.