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.

Funzioni: overload<strong>in</strong>g o<br />

polimorfismo<br />

Funzioni con stesso nome e ma differente lista di parametri<br />

di <strong>in</strong>put (per numero o tipo) e return type si dicono<br />

polimorfe.<br />

Per esempio vuoi un funzione che ti raddoppi qualunque<br />

cosa tu gli passi (<strong>in</strong>teri,float,double ..)<br />

Es di prototipo:<br />

<strong>in</strong>t Double(<strong>in</strong>t);<br />

float Double(float);<br />

double Double(double);<br />

Analoga la def<strong>in</strong>izione di queste funzioni.<br />

A seconda di cosa gli passi nel programma lui usa una<br />

delle forme di questa funzione Double.

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

Saved successfully!

Ooh no, something went wrong!