Pass by value:
The main aspect of pass by value is :”You cannot modify the values you pass into the function”. But you may wonder how ‘t’ got changed?
Actually if you examine carefully,’t’ never changed.The object which ‘t’ was referencing got changed.
Pass by Reference:
If you can modify the values passed onto a function,then it is pass by reference.
Pass by Reference in C:
Pass by Reference in C++: