Concept

How are functions defined and declared in modern C?

ComputerScienceOne / Declaration: Prototypes

"For modern C, defining functions is a two step process. First, you declare a function and its signature using a prototype. Then you define the function by providing a function body that defines what the function does. Just as with variables, functions in C must be declared before they can be used. The modern way to declare a function in C is to use a prototype declaration which specifies the function’s signature including its return type, identifier, and parameters. However, a prototype does not include the actual body of function. Instead, the function’s definition, which includes the function body is included later in the program. Consequently, a prototype always ends with a semicolon."

Related Ideas

How are functions defined and declared in modern C? | ComputerScienceOne | Bifalgorithm | Bifalgorithm