Professional Documents
Culture Documents
C++ Functions
C++ Functions
Functions
What is a functions?
How to declare a function?
Composition of a function.
Composition of a function.
Function name
Parameters
Return type
Function body
Function Declarations
Calling a Function
Example
TYPES OF FUNCTIONS:
• VOID FUNCTION WITHOUT PARAMETERS
• VOID FUNCTION WITH PARAMETERS
• NON VOID FUNCTION WITHOUT PARAMETERS
• NON VOID FUNCTION WITH PARAMETERS
VOID FUNCTIONS WITHOUT
PARAMETER:
Output
TYPES OF ARGUMENTS OF
FUNCTION
FUNCTIONS – CALL BY VALUE
FUNCTIONS – CALL BY VALUE -
EXAMPLE
RESULT:
FUNCTIONS – CALL BY POINTER
FUNCTIONS – CALL BY POINTER -
EXAMPLE
RESULT:
FUNCTIONS – CALL BY REFERENCE
FUNCTIONS – CALL BY REFERENCE -
EXAMPLE
RESULT: