Category: Function prototypes in C++

Interested in learning C Programming? Click here...


Function-Prototypes-in-Cpp 1

Function Prototypes in C++

All the functions in C++ (which are used first and defined later in the program) need to be prototyped. Function prototypes are usually written at the beginning of the program, ahead of any programmer-defined functions (including main()). The general form of a function prototype is:

Where, data-type represents the data-type of the item that is returned by the function, function_name represents the function name, and type 1, type 2, …, type n represents the data-type of the arguments arg 1, arg 2, …, arg n. Notice that a function prototype resembles the first line of a function definition (though...