26.07.2013 Views

Passagem de Parâmetros e Estruturas

Passagem de Parâmetros e Estruturas

Passagem de Parâmetros e Estruturas

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>Estruturas</strong> como parâmetros <strong>de</strong> funções<br />

void le_coor<strong>de</strong>nada(ponto *p1) {<br />

float x, y;<br />

printf("Digite a coor<strong>de</strong>nada x e y\n");<br />

scanf("%f %f", &x, &y);<br />

p1->x = x;<br />

p1->y = y;<br />

}<br />

en<strong>de</strong>reço variável conteúdo<br />

F000 u | x 1.5<br />

F010 u | y 2.0<br />

F020 v | x 30.0<br />

F030 v | y 25.5<br />

F040 p1 F020<br />

F050 x 30.0<br />

F060 y 25.5<br />

F070<br />

le_coor<strong>de</strong>nada(&v);<br />

29

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

Saved successfully!

Ooh no, something went wrong!