|
1 | 1 | --- |
2 | | -title: "Address-of Operator: &" |
| 2 | +title: "Address-of operator: &" |
3 | 3 | description: "The address-of operator in the C++ language." |
4 | 4 | ms.date: 10/02/2020 |
5 | 5 | f1_keywords: ["&"] |
6 | 6 | helpviewer_keywords: ["address-of operator (&)", "& operator", "& operator [C++], address-of operator"] |
7 | 7 | ms.assetid: 2828221a-15f6-4acc-87fe-25e34feebb88 |
8 | 8 | --- |
9 | | -# Address-of Operator: `&` |
| 9 | +# Address-of operator: `&` |
10 | 10 |
|
11 | 11 | ## Syntax |
12 | 12 |
|
13 | | -> **`&`** *`cast-expression`* |
| 13 | +*`address-of-expression`*:\ |
| 14 | +  **`&`** *`cast-expression`* |
14 | 15 |
|
15 | 16 | ## Remarks |
16 | 17 |
|
17 | | -The unary address-of operator (**`&`**) takes the address of its operand. The operand of the address-of operator can be either a function designator or an l-value that designates an object that's not a bit field. |
| 18 | +The unary address-of operator (**`&`**) returns the address of (that is, a pointer to) its operand. The operand of the address-of operator can be a function designator. Or, it can be an lvalue that refers to an object that's not a bit field. |
18 | 19 |
|
19 | | -The address-of operator can only be applied to variables of fundamental, structure, class, or union types that are declared at the file-scope level, or to subscripted array references. In these expressions, a constant expression that doesn't include the address-of operator can be added to or subtracted from the address-of expression. |
| 20 | +The address-of operator can only be applied to certain lvalue expressions: either to variables of fundamental, structure, class, or union types, or to subscripted array references. In these expressions, a constant expression (one that doesn't include the address-of operator) can be added to or subtracted from the address-of expression. |
20 | 21 |
|
21 | | -When applied to functions or l-values, the result of the expression is a pointer type (an r-value) derived from the type of the operand. For example, if the operand is of type **`char`**, the result of the expression is of type pointer to **`char`**. The address-of operator, applied to **`const`** or **`volatile`** objects, evaluates to `const type *` or `volatile type *`, where `type` is the type of the original object. |
| 22 | +When applied to functions or lvalues, the result of the expression is a pointer type (an rvalue) derived from the type of the operand. For example, if the operand is of type **`char`**, the result of the expression is of type pointer to **`char`**. The address-of operator, applied to **`const`** or **`volatile`** objects, evaluates to `const type *` or `volatile type *`, where `type` is the type of the original object. |
22 | 23 |
|
23 | | -The address of an overloaded function can be taken only when it's clear which version of the function is being referenced. See [Function Overloading](function-overloading.md) for information about how to obtain the address of a particular overloaded function. |
| 24 | +You can only take the address of an overloaded function when it's clear which version of the function is referenced. For more information about how to obtain the address of a particular overloaded function, see [Function overloading](function-overloading.md). |
24 | 25 |
|
25 | 26 | When the address-of operator is applied to a qualified name, the result depends on whether the *qualified-name* specifies a static member. If so, the result is a pointer to the type specified in the declaration of the member. For a member that isn't static, the result is a pointer to the member *name* of the class indicated by *qualified-class-name*. For more information about *qualified-class-name*, see [Primary expressions](../cpp/primary-expressions.md). |
26 | 27 |
|
@@ -98,7 +99,7 @@ int main() { |
98 | 99 |
|
99 | 100 | ## See also |
100 | 101 |
|
101 | | -[Expressions with Unary Operators](../cpp/expressions-with-unary-operators.md)<br/> |
102 | | -[C++ Built-in Operators, Precedence, and Associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)<br/> |
103 | | -[Lvalue Reference Declarator: &](../cpp/lvalue-reference-declarator-amp.md)<br/> |
104 | | -[Indirection and Address-of Operators](../c-language/indirection-and-address-of-operators.md) |
| 102 | +[Expressions with unary operators](../cpp/expressions-with-unary-operators.md)\ |
| 103 | +[C++ built-in operators, precedence, and associativity](../cpp/cpp-built-in-operators-precedence-and-associativity.md)\ |
| 104 | +[Lvalue reference declarator: `&`](../cpp/lvalue-reference-declarator-amp.md)\ |
| 105 | +[Indirection and address-of operators](../c-language/indirection-and-address-of-operators.md) |
0 commit comments