6.1 Primary Expressions

Simple expressions are called primary expressions; they denote values. Primary expressions include previously declared identifiers, constants, string literals, and parenthesized expressions.

Primary expressions have the following syntax:

primary-expression:

   identifier
   constant
   string-literal
   expression

The following sections describe the primary expressions.

6.1.1 Identifiers

An identifier is a primary expression provided it is declared as designating an object or a function.

An identifier that designates an object is an lvalue if its type is arithmetic, structure, union, or pointer. The name of an array evaluates to the address of the first element of the array; an array name is an lvalue but not a modifiable lvalue.

An identifier that designates a function is called a function designator. A function designator evaluates to the address of the function.

6.1.2 Constants

A constant is a primary expression. Its type depends on its form (integer, character, floating, or enumeration); see Section 1.8. A constant is never an lvalue.

6.1.3 String Literals

A string literal is a primary expression. Its type depends on its form (character or wchar_t ); see Section 1.8. A string literal is an lvalue.

6.1.4 Parenthesized Expressions

An expression within parentheses has the same type and value as the expression without parentheses would have. Any expression can be delimited by parentheses to change the precedence of its operators.


Previous Page | Next Page | Table of Contents | Index