C++ Call by Value

tutorial and example
tutorial and example

C++ Function

A function is a set of statements that executes a task. In C++, functions are categorized into two different categories on the behalf of argument (parameter) pass.

  1. Function with parameter (return_type function_name(parementer);)
  2. Function without parameter (return_type function_name();)

Function which takes parameter in function is called function with parameter. A function which does not take parameter in function is called function without parameter.

Function with parameter has further categorized into two different categories.

  1. Call by value
  2. Call by reference.

C++ call by value

In call by value function, action performed is done over the copy of actual value pass in the parameter. So that in call by value the actual value of the program never affected. The action on value is performed on current function.

C++ call by value Example