Function Declaration and Definition
You have already learned from the previous chapters that you can create and call a function in the following way:
Example
// Create a function void myFunction() { printf("I just got executed!"); } int main() { myFunction(); // call the function return 0; }
A function consist of two parts :
- Declaration: the function’s name, return type, and parameters (if any)
- Definition: the body of the function (code to be executed)