HPlogo HP C/HP-UX Reference Manual: Workstations and Servers > Chapter 5 Expressions

Primary Expressions

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The term primary expression is used in defining various C expressions.

Syntax

primary-expression ::=
identifier
constant
string-literal
(expression)

Description

A primary expression is an identifier, a constant, a string literal, or an expression in parentheses that may or may not be an lvalue expression. Primary expressions are the basic components of all expressions.

An identifier can be a primary expression provided that you have declared it properly. A single identifier may or may not be an lvalue expression. A function name is not an lvalue.

A constant is a primary expression and can never be an lvalue.

A string literal is a primary expression. The type of the string literal is "array of characters." If the string literal appears in any context other than as the operand of sizeof, the operand of unary &, or the initializer for an array of characters, it is converted to a pointer to the first character.

Examples

   identifier:  var1

constant: 99

string-literal: "hi there"

( expression ) (a+b)