Define Function? There are two types of function built-in functions and user-defined functions. Built-in functions are the function within C++ like main, setw, sqrt, etc. User-defined functions are the functions produced by the user or the programmer for a specific job. The advantage of producing function is it reduces program size, easy to maintain and modify. Only the statements called within the main function will be executed.
The use-defined function must have a prototype (declaration) before it can be called
except for inline function. There are other functions like friendly function and virtual function which will be discussed later.