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

Create successful ePaper yourself

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

Un esempio di ricapitolazione<br />

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

Enum BOOL {FALSE,TRUE}<br />

typedef unsigned short <strong>in</strong>t USHORT;<br />

USHORT menu();<br />

void DoTaskOne();<br />

void DoTaskMany(USHORT);<br />

<strong>in</strong>t ma<strong>in</strong>()<br />

{<br />

BOOL exit =FALSE;<br />

for ( ; ;)<br />

{<br />

USHORT choice =menu();<br />

switch(choice)<br />

{ case(1):DoTaskOne();<br />

break;<br />

case(2) :DoTaskMany(2);<br />

break; //pui usare il break per uscire da un do while loop ma anche da un for <strong>in</strong>f<strong>in</strong>ito e da uno switch statement<br />

case(3):DoTaskmany(3);<br />

break;<br />

case(4): break;<br />

case(5):exit=TRUE;<br />

break;<br />

default: cout

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

Saved successfully!

Ooh no, something went wrong!