Function Declaration

C programming functions contain pieces of code to be executed whenever the function is called in a program. C programs contain a number of custom functions which can be called as required during the execution of the program.

Functions contain a group of statements which are executed whenever the function is called. Once their statements have been executed program flow resumes at the point the function was called. This modularity is very useful in programming to separate set routines so they can be used repeatedly.

To introduce a custom function into a program it must first be declared, in a similar manner that variables must be declared before they can be used. Function declarations should be added to the program code before the main () function.

Like the main () function, custom function can return a value. The data type of this value must be included in the function declaration. If the function is to return no value its return data type should be declared with the void keyword. The function should be named following the same naming conventions used for variable names.

The function declaration is more correctly called the function prototype and simply informs the compiler about the function. The actual function definition, which includes the statements to be executed, appears after the main () function. The custom function then be called upon to execute its statements from within the main () function, as required.

If a custom function returns a value this value can be assigned to a variable of the appropriate data type, or simply displayed as output using the appropriate format specifier. The function prototype also sometimes referred to as the function header.

Custom functions can call other custom functions, just as readily as they can call standard library functions like printf (). Multiple functions can called from other functions that is called function can call other function.

Quick Note: Taking the Nonsense out of looking for the right spyware remover

If you really want to take the work out of looking for that right Spyware Protection from a Spybot go to the Internet and get a Free Spybot or a Free Spybot Search and Destroy
Download, In order to prevent your vital information from being ripped from your computer get your Spybot Remover Today.

Functions that call themselves are known as `recursive` functions. As with a loop the function must modify a tested condition to avoid locking the program. When developing larger programs some thought should be given to program structure. Maintaining the entire program code in a single file can become unwieldy as the program grows. In order to simplify the program structure a custom header file can be created to contain functions which may be used repeatedly. This should be named with a `.h` file extension, like the standard header.

About the Author:

You really want to take the work out of looking for Protection from a lurking theif then you should get your free Spybot to protect you. Go to the Internet and get The New Free Spybot Download or just Spybot
to prevent your vital information from being taken from you and given to someone who will steal your money or something else that you treasure so dearly.

Article Source: ArticlesBase.com - Function Declaration

Spybot, Free Spybot Download, Spybot Search And Destroy, Free Spybot, Spybot Download, Spybot Search And Destroy Downloads