2 <clause number="25.5.4" title="The address-of operator">
3 <paragraph>An <non_terminal where="25.5.4">addressof-expression</non_terminal> consists of an ampersand (&) followed by a <non_terminal where="14.6">unary-expression</non_terminal>. <grammar_production><name><non_terminal where="25.5.4">addressof-expression</non_terminal></name> : <rhs><terminal>&</terminal><non_terminal where="14.6">unary-expression</non_terminal></rhs></grammar_production></paragraph>
4 <paragraph>Given an expression E which is of a type T and is classified as a fixed variable (<hyperlink>25.3</hyperlink>), the construct &E computes the address of the variable given by E. The type of the result is T* and is classified as a value. A compile-time error occurs if E is not classified as a variable, if E is classified as a volatile field (<hyperlink>17.4.3</hyperlink>), or if E denotes a moveable variable. In the last case, a fixed statement (<hyperlink>25.6</hyperlink>) can be used to temporarily "fix" the variable before obtaining its address. </paragraph>
5 <paragraph>The & operator does not require its argument to be definitely assigned, but following an & operation, the variable to which the operator is applied is considered definitely assigned in the execution path in which the operation occurs. It is the responsibility of the programmer to ensure that correct initialization of the variable actually does take place in this situation. </paragraph>
7 <example>[Example: In the example <code_example><![CDATA[
20 ]]></code_example>i is considered definitely assigned following the &i operation used to initialize p. The assignment to *p in effect initializes i, but the inclusion of this initialization is the responsibility of the programmer, and no compile-time error would occur if the assignment was removed. end example]</example>
23 <note>[Note: The rules of definite assignment for the & operator exist such that redundant initialization of local variables can be avoided. For example, many external APIs take a pointer to a structure which is filled in by the API. Calls to such APIs typically pass the address of a local struct variable, and without the rule, redundant initialization of the struct variable would be required. end note]</note>
26 <note>[Note: As stated in <hyperlink>14.5.4</hyperlink>, outside an instance constructor or static constructor for a struct or class that defines a readonly field, that field is considered a value, not a variable. As such, its address cannot be taken. </note>
29 <note>Similarly, the address of a constant cannot be taken. end note]</note>