December 1998
Intermediate to advanced
624 pages
13h 8m
English
Pointer declarations should be read right to left.
If Fred is some type, then
• Fred* is a pointer to a Fred (the * is pronounced “pointer to a”).
• const Fred* is a pointer to a Fred that cannot be changed via that pointer.
• Fred* const is a const pointer to a Fred. The Fred object can be changed via the pointer, but the pointer itself cannot be changed.
• const Fred* const is a const pointer to a Fred that cannot be changed via that pointer.
References are similar: read them right to left.
• Fred& is a reference to a Fred (the & is pronounced “reference to a”).
• const Fred& is a reference to a Fred that cannot be changed via that reference.
Note that Fred& ...
Read now
Unlock full access