C++
Functions in C++
§ Function is a block of code performing a unit task.
§ Function has a name, return type and arguments.
§ Function is a way to achieve modularization.
§ Function are Predefined and user defined.
§ Predefined functions are declared in header files and defined in library files.
Function Definition, Declaration and Call
Declaration
§ Function declaration is also known as function prototype.
§ Functions need to be declared before use. (Just like variable).
§ Functions can be declared locally or globally.
§ Return_type function_name(arguments);
§ Function definition is a block of code.
Ways to define a function?
§ Takes Nothing, Return Nothing
§ Takes something, Return Nothing
§ Takes Nothing, Returns Something
§ Takes Something, Return Something
Formal and Actual Arguments
**You reached end of lecture**

Post a Comment
0 Comments