20.09.2015 Views

Programming in C

Kochan - ProgramminginC

Kochan - ProgramminginC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

440 Appendix A C Language Summary<br />

An expression of any type other than void that identifies a data object is called an<br />

lvalue. If it can be assigned a value, it is known as a modifiable lvalue.<br />

Modifiable lvalue expressions are required <strong>in</strong> certa<strong>in</strong> places.The expression on the<br />

left-hand side of an assignment operator must be a modifiable lvalue. Furthermore, the<br />

<strong>in</strong>crement and decrement operators can only be applied to modifiable lvalues, as can the<br />

unary address operator & (unless it’s a function).<br />

5.1 Summary of C Operators<br />

Table A.5 summarizes the various operators <strong>in</strong> the C language.These operators are listed<br />

<strong>in</strong> order of decreas<strong>in</strong>g precedence. Operators grouped together have the same precedence.<br />

Table A.5 Summary of C Operators<br />

Operator Description Associativity<br />

() Function call<br />

[] Array element reference<br />

-> Po<strong>in</strong>ter to structure member reference Left to right<br />

. Structure member reference<br />

- Unary m<strong>in</strong>us<br />

+ Unary plus<br />

++ Increment<br />

-- Decrement<br />

! Logical negation<br />

~ Ones complement Right to left<br />

* Po<strong>in</strong>ter reference (<strong>in</strong>direction)<br />

&<br />

Address<br />

sizeof Size of an object<br />

(type)<br />

Type cast (conversion)<br />

* Multiplication<br />

/ Division Left to right<br />

% Modulus<br />

+ Addition Left to right<br />

- Subtraction<br />

> Right shift<br />

< Less than<br />

Greater than<br />

=> Greater than or equal to

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!