Record some of the things you read about this book.
I. References (reference)
The reference has a different name for the object. For example:
int ival=1024;
int &relval1=ival;//to, attention try not to use this way:int& relval=ival;
int &relval2;//error, reference must be initialized
When a reference is defined, the program binds the reference with its initial value (binding) instead of copying the initial value to the reference. Once the initialization is complete, the reference will always be bound together with its initial value object. Because the reference cannot be re-bound to another object, the reference must be initialized.
Note the following definition methods:
int i=0;
int &relval=i, R=i;////relval is a reference, R is not
int &relval=i, &r=i;//relval, and R are all references
Second, the pointer (pointer)
The type of pointer you see today is primarily a simple definition of pointers and uses that do not involve difficult applications and subsequent additions.
Third, reference and pointer mixing
int i=3;
int &r=i;
int *p=&i;
int *&R1=P;//R1 is a reference to a team pointer p
Because a reference is not an object, you cannot define a pointer to a reference.
C + + Primer Fifth Edition essay-January 6, 2015