What is the representation quoted by C++?
Today, the editor would like to share with you the relevant knowledge of what the expression method quoted by C++ is. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article, let's take a look at it.
The concept of citation
A reference is not a new definition of a variable, but an alias to an existing variable, and the compiler does not open up memory space for the reference variable, which shares the same memory space as the variable it references.
Representation of references
Type & reference variable name (object name) = reference entity
If you are familiar with the C language, you may find that the reference symbol (&) looks like the address operator (&) or the bitwise AND operator (&), but this is an example of operator overloading. By overloading, the same operator will have different meanings. The compiler determines the meaning of the operator through the context. In addition to what is mentioned here, there are actually some cases of operator overloading in C++. For example: * represents both multiplication and dereferencing of pointers