Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 1011 Bytes

README.md

File metadata and controls

16 lines (10 loc) · 1011 Bytes

Pointer-Operations-in-CPP

##AIM: To study about pointer operations in C++

##THEORY:

In C++ pointer operations are nothing but call by value and call by reference.

Call by value:
In call by value, original value is not modified.In this, value being passed to the function is locally stored by the function parameter in stack memory location. If you change the value of function parameter, it is changed for the current function only. It will not change the value of variable inside the caller method such as main().

Call by reference:
In call by reference, original value is modified because we pass reference (address). Here, address of the value is passed in the function, so actual and formal arguments share the same address space. Hence, value changed inside the function, is reflected inside as well as outside the function.

Screenshot 2023-10-10 163717