06.01.2015 Views

IMPARARE IL C++ in 6 ore? - INFN

IMPARARE IL C++ in 6 ore? - INFN

IMPARARE IL C++ in 6 ore? - INFN

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.

Accedere ai membri e ai metodi di una<br />

classe tramite il puntat<strong>ore</strong> alla medesima<br />

Accedi alle funzioni/membri di una classe con l’operat<strong>ore</strong> ( . ).Se<br />

pero’ tratti con puntatori prima devi dereferenzare (*) il<br />

puntat<strong>ore</strong> all’oggetto: (*pCar).GetYear(); C’e’ un modo piu’<br />

compatto:<br />

pCar->GetYear(); Esempio:<br />

#<strong>in</strong>clude<br />

class Cat<br />

{<br />

public:<br />

Cat() {itsAge=2;}<br />

~Cat() {cout

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

Saved successfully!

Ooh no, something went wrong!