19.04.2013 Views

Aula 3 – Alocação Dinâmica - CAFW - UFSM

Aula 3 – Alocação Dinâmica - CAFW - UFSM

Aula 3 – Alocação Dinâmica - CAFW - UFSM

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.

void troca(int* a, int* b) {<br />

int aux;<br />

aux = *a;<br />

*a = *b;<br />

*b = aux;<br />

}<br />

Agora sim!<br />

void main {<br />

int x = 5;<br />

int y = 10;<br />

troca(&x, &y);<br />

printf(“x = %d, y = %d”, x,y);<br />

}

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

Saved successfully!

Ooh no, something went wrong!