What is the difference between declaration and prototype in C? In which situations they are called declarations and in which prototypes?
A function declaration is any form of line declaring a function and ending with ;
.
A prototype is a function declaration where all types of the parameters are specified.
Example, prototype function declaration: void func (void);
Example, non-prototype function declaration: void func ();
.
Non-prototype function declarations is an obsolescent feature (6.11.6) that may get removed from the C language. Therefore you should always use prototype format and never anything else.