-1

For example in

int *a = 5;
MyFunc(&a);

What are the behind the scenes working of '&' Is it just creating a pointer to the pointer and deferencing it automatically? or is it doing something different.

Is there any way to pass by "true" reference in C++ or will everything be a pointer passed by value?

Prodigle
  • 1,757
  • 12
  • 23
  • 4
    I don't see any references here. `&a` is not a reference, it is an address of `a`, it has type `int**`. – Evg Nov 16 '18 at 11:06

1 Answers1

-1

References in C++ are basically implemented as pointers. I would assume that's how they're implemented in all languages, not just C++.

There's an earlier question with better answers here: How is reference implemented internally?

James
  • 161
  • 7