23.03.2013 Views

Arrays, parameter passing, pointers and dynamic allocation. - ELIS

Arrays, parameter passing, pointers and dynamic allocation. - ELIS

Arrays, parameter passing, pointers and dynamic allocation. - ELIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Parameter Arithmetic & <strong>Arrays</strong><br />

S int v[5]; int *vPtr = v; (or = &v[0];)<br />

S v[3] == * (vPtr + 3) == * (v + 3) == vPtr[3]<br />

S vPtr + 3 is the same as &v[3]<br />

S Array names cannot be modified in arithmetic expressions<br />

because they are constant.<br />

61

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

Saved successfully!

Ooh no, something went wrong!