What are “prototypes” in a C program?

The book’s I’m using to learn C explains something called “prototypes” which I couldn’t understand properly. In the book, the following sample code explains these “prototypes”. What does this mean here? What are the “prototypes”?

//* two_func.c -- a program using two functions in one file */
#include <stdio.h>
void butler(void);
int main(void)
{
    printf("I will summon the butler function.\n");
    butler();
    printf("Yes! bring me some tea and writable DVD's.\n");
    getchar();
    return 0;
}

void butler(void)   /*start of function definition*/

{
    printf("You rang,sir.\n");

}

Please explain in simple terms.

Leave a Comment