Вы находитесь на странице: 1из 2

Functions

We often write large programs and it is a good idea to split large steps into smaller
procedures. These small procedure blocks are known as functions. Functions are often
required to do repetitive jobs. We can define a function and call them from anywhere we
need. This is a good choice for code reuse and code size optimization.
Call by value

In call by value mechanism, the called function creates a new set of variables in stack
and copies the values of the arguments into them.

Call by reference
In call by reference mechanism, instead of passing values to the function being called,
references/pointers to the original variables are passed.

Вам также может понравиться