| title | Types of Expressions | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | index-page | |||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 1e7540b0-8fdb-49ab-b3e1-6ec439ff473a | |||||||||||||
| caps.latest.revision | 6 | |||||||||||||
| author | mikeblome | |||||||||||||
| ms.author | mblome | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
C++ expressions are divided into several categories:
-
Primary expressions. These are the building blocks from which all other expressions are formed.
-
Postfix expressions. These are primary expressions followed by an operator — for example, the array subscript or postfix increment operator.
-
Expressions formed with unary operators. Unary operators act on only one operand in an expression.
-
Expressions formed with binary operators. Binary operators act on two operands in an expression.
-
Expressions with the conditional operator. The conditional operator is a ternary operator — the only such operator in the C++ language — and takes three operands.
-
Constant expressions. Constant expressions are formed entirely of constant data.
-
Expressions with explicit type conversions. Explicit type conversions, or "casts," can be used in expressions.
-
Casting. Type-safe "casts" can be used in expressions.
-
Run-Time Type Information. Determine the type of an object during program execution.