1) You can create an array of links.
According to the C ++ standard (8.3.4 Arrays)
- ... T is called the array element type; This is a void, a function type or an abstract class.
That is, array elements cannot be references, or have type void (but can be pointers to type Void), cannot have type of functions (but can be pointers to functions) and cannot be objects of an abstract class.
2) Pointers may be uninitialized.
If the pointer is not constant, then it may not be initialized.
3) Pointers can be subtracted
From standard C ++ (5.7 Additive operators)
2 For subtraction, one of the following
- both operands have arithmetic or unscoped enumeration type; or
- both operands are pointers to the same fully defined object type ; or
It is a rule of reference to a completely undefined object type.
And there
If youβre on the top of the line up
That is, when two pointers address elements of the same array, their difference is equal to the difference between the indices of the addressed elements of the array.
4) Pointers can be multiplied by an integer.
The C ++ standard section "5.6 Multiplicative operators" states that
2 The operands of arithmetic or unscale enumeration type;
For pointers, the multiplication operation is not defined.
5) Pointers can be added to each other.
Returning to the C ++ standard section "5.7 Additive operators", we see that the addition operation is not defined for pointers
- ... In addition, either it can be an integral type or an enumeration type.
Do not add pointers.
6) Links may be uninitialized.
In the C ++ standard section "8.3.2 References" it is written that
- ... this is a class member (9.2) a parameter or a return type (8.3.5); see 3.1. 7)
That is, when a link is declared, the link must be initialized except when it is declared with the extern qualifier, is a member of the class, is a declaration within the class, or a function parameter declaration.
Cannot get link address
Links can be thought of as object names. When a reference is used, the operator takes the address & , then the address of the object to which the link "links" is returned. The address of the link itself cannot be obtained, since at least the standard does not specify whether the links require memory for themselves or not.