Difference between pass by value and pass by reference - C++

Difference between pass by value and pass by reference.

Pass by ValuePass by Reference
Passes an argument by value.Passes an argument by reference.
Specifying the ByVal keyword.Specifying the ByRef keyword.
The procedure code does not have any access to the underlying element in the calling code.The procedure code gives a direct reference to the programming element in the calling code.
In this, you are sending a copy of the data.In this, you are passing the memory address of the data that is stored.
Changes does not affect the actual value.Changes to the value effect the original data.
What are references in C++? What is a local reference?
What are references in C++? - A restricted type of pointer in C++ is known as a reference...
What is static class data? - C++
What is static class data? - Static data members of a class are declared by preceding the member variable’s declaration with the keyword static....
Uses of static class data
Uses of static class data - To provide access control mechanism to some shared resource used by all the objects of a class...
Post your comment