Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP C/HP-UX Reference Manual: HP-UX Systems > Chapter 5 Expressions and Operators

lvalue Expressions

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » 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 */

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.