Concept

What capabilities and constraints do functions have in C?

ComputerScienceOne / Declaration: Prototypes

"As a procedural-style language, functions are essential in C programming. As we’ve already seen, C provides a large library of standard functions to perform basic input/output, math, and many other functions. C also provides the ability to define and use your own functions. When you define functions in C, careful thought must be made as to the naming of your functions. This is because C does not support function overloading. When you name a function, that is the only function that can have that name. Consequently, you cannot, in general, use the same function names as defined in the standard libraries or any other 3rd party library that you would like to use in your programs. C supports both call by value and call by reference using pointers (see Section 18.2). C also supports vararg functions (printf() being a prime example) and allows you to define vararg functions, but we will not cover them in depth here. Finally, parameters are not, in general, optional. For modern versions of C the omission of parameters is a syntax error. For older versions, complex rules dictate what happens when arguments are omitted, but doing so usually results in garbage."

Related Ideas

What capabilities and constraints do functions have in C? | ComputerScienceOne | Bifalgorithm | Bifalgorithm