No. Pass/Call by value makes an independent copy of the value for use in a function, but pass/call by reference uses the same object that was passed as an argument. Everyone likes to keep saying it, but C does not have pass by reference. It can only be faked passing pointers by value and using indirection them to get the original object.
why do we use call by value and pass by value? what are its uses?
Here is a 10,000 foot overview. Use pass by reference when:
The object is very large and passing it by value would be costly for memory. Make it const if it should not be changed.
The original object needs to be changed within a function and cannot be used as a return value.
Use pass by value when:
The value is small and the original object does not need to be changed within a function.
In the context of C, 'pass by reference' really means 'pass a pointer by value'. The whole thing is kind of a solved problem because C is such a small language. You either pass a pointer or not, depending on your needs. I think a more interesting question is whether or not value parameters should be made const:
void Function1(int x, int y);
void Function2(int const x, int const y);
Just curious, what do you think C++ does when it passes by reference.
I think the easier implementation would pass by pointer and hide the pointer mechanics on the compiler side. A more "pure" implementation of references might somehow mark the reference and replace it with the same address as the original variable when generating machine code. That is neither here nor there as this is the C forum. :)
You said pass by reference doesn't copy the value or the address of the data.
Not so. I said something more general because C does not have native pass by reference semantics:
pass/call by reference uses the same object that was passed as an argument
How the same object is used is an implementation detail, and the detail does not matter as long as the effect of pass by reference is achieved without programmer intervention.
The programmer intervention part is why I do not believe C supports pass by reference. If I need to do something special beyond declaring a reference, the effect of pass by reference is not fully achieved. With pass by pointer I need to assign the address of the object before calling the function and I need to dereference the pointer to get to the object inside the function.