12.05.2015 Views

type - David Vernon

type - David Vernon

type - David Vernon

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Arrays, Pointers, and Strings<br />

Address Arithmetic<br />

• Address of operator &<br />

The value of an expression &x is an address<br />

• Other expressions yield addresses<br />

– the name of an array, written without brackets<br />

– the address is that of the first element of the array<br />

char s[50];<br />

s is equivalent to &(s[0])<br />

– we can combine the name of an array with integers<br />

s<br />

s+i<br />

is equivalent to &(s[0])<br />

is equivalent to &(s[i])<br />

Copyright © 2007 <strong>David</strong> <strong>Vernon</strong> (www.vernon.eu)

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

Saved successfully!

Ooh no, something went wrong!