HPlogo HP C/HP-UX Reference Manual: Version A.05.55.02 > Chapter 5 Expressions and Operators

lvalue Expressions

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

An lvalue (pronounced “el-value”) is an expression that refers to a region of storage that can be manipulated.

For example, all simple variables, like ints and floats are lvalues. An element of an array is also an lvalue; however an entire array is not. A member of a structure or union is an lvalue; an entire structure or union is not.

Given the following declarations:

int *p, a, b;
int arr[4];
int func();

a /* lvalue */
a + b /* Not an lvalue */
p /* lvalue */
*p /* lvalue */
arr /* lvalue, but not modifiable */
*(arr + a) /* lvalue */
arr[a] /* lvalue, equivalent to *(arr+a) */
func /* Not an lvalue */
func() /* Not an lvalue */

© Hewlett-Packard Development Company, L.P.