I haven't understand passing by reference in C++ completely. I already read related questions like the following ones.
- What are the differences between a pointer variable and a reference variable in C++?
- Are there benefits of passing by pointer over passing by reference in C++?
- When to use references vs. pointers
But even though I understand that it is different to a pointer, I don't fully understand the concept of reference in C++. How does it work? I seems like reference is a special case of a pointer and might be implemented as such by the compiler. But it behaves different on programming level. Is that correct?
Is the concept of passing by reference a special case of passing a pointer to that value? Many times I have to decide whether to use reference or pointer while programming. Moreover I want to understand the underlying principle. Is only the memory address copied?