C ++ - the difference between pointers and references

1) is a pointer to the object, they have their own space. The only reference to an alias, do not take up space.

2) 4 pointer sizeof (structure 32), the reference size is the size of the referenced object.

3) may not initialize the pointer (wild pointer, this mode is generally not used), initialized to NULL or pointing object. While at the same time a reference to the object must be initialized referenced in the statement.

4) as an argument, a pointer needs to be dereferenced in order to access objects, direct access to the object reference.

5) may change its pointer to point, but can not change the reference.

6) pointer can have multiple level indicators, only a general reference (multiple levels of reference).

7)

Guess you like

Origin www.cnblogs.com/cjj-ggboy/p/12381245.html