0

I can not distingish between the object and the variable.As mentioned in C++ Primer,the reference is not a object.But we sometimes refer to the reference as the variable.Does a reference have no memory, so why call it a variable?So ,how should I distinguish bewteen the object and the variable?

I have seen the explanation of a lot of people about the reference.But I do not have a clue.

ajowa
  • 1
  • *".Does a reference have no memory, ..."* this is implementation detail. From standard's POV a reference is an alias and should be looked at that way. See duplicate: [Contradicting definition of references](https://stackoverflow.com/questions/71529819/contradicting-definition-of-references) – Jason Apr 18 '23 at 04:02
  • Personally I think of references as immutable pointers. I know that is not technically correct and I know the syntax is different, but it's how it was first explained to me, and I think I have a good grasp of how they work. But I was a C programmer before a C++ programmer so I had a good understanding of pointers already. – john Apr 18 '23 at 06:21

0 Answers0