Understand the difference between declaring a function (prototype) and defining its actual implementation.
In C, working with functions involves two distinct but related concepts: declaration and definition. It's crucial to understand the role of each. A **function declaration**, also known as a function prototype, is a statement that introduces a function to the compiler. It provides the function's essential information: its name, its return type (the type of value the function sends back), and the types of its parameters (the values it accepts as input). The declaration does not contain the actual body of the function. It simply acts as a blueprint, allowing the compiler to know that a function with this signature exists somewhere in the program. This is particularly important when you call a function before its definition appears in the source code, or when the definition is in a different file. The prototype ensures the compiler can check if you are calling the function correctly (e.g., with the right number and types of arguments). A typical declaration looks like this: `int add(int a, int b);`. A **function definition**, on the other hand, is where you provide the actual implementation of the function. It includes the function header (which looks just like the declaration, but without the semicolon) and the function body enclosed in curly braces `{}`. The body contains the C statements that perform the function's specific task. The definition is what reserves memory for the function and contains the executable code. For example: `int add(int a, int b) { return a + b; }`. While you can declare a function multiple times (though it's redundant), you can only define a function once in a program to avoid a linker error.