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.

Volatile/Mutable/const_cast<br />

S Keyword volatile means variable could be modified by hardware<br />

not known to the compiler. Key to tell compiler not to optimize it.<br />

S Cast const_cast adds or removes const <strong>and</strong> volatile modifiers<br />

S Useful when get const char* back from function, <strong>and</strong> you need to<br />

modify it.<br />

S Keyword mutable is an alternative to const_cast.<br />

S mutable member variable is always modifiable even with const<br />

member function or const object of that class.<br />

82

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

Saved successfully!

Ooh no, something went wrong!