14.03.2015 Views

Apostila C da UFMG - Universidade do Minho

Apostila C da UFMG - Universidade do Minho

Apostila C da UFMG - Universidade do Minho

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

}<br />

if (v == NULL) {<br />

printf ("** Erro: Memoria Insuficiente **");<br />

return (NULL);<br />

}<br />

/* aloca as colunas <strong>da</strong> matriz */<br />

for ( i = 0; i < m; i++ ) {<br />

v[i] = (float*) calloc (n, sizeof(float));<br />

if (v[i] == NULL) {<br />

printf ("** Erro: Memoria Insuficiente **");<br />

return (NULL);<br />

}<br />

}<br />

return (v); /* retorna o ponteiro para a matriz */<br />

float **Liberar_matriz_real (int m, int n, float **v)<br />

{<br />

int i; /* variavel auxiliar */<br />

if (v == NULL) return (NULL);<br />

if (m < 1 || n < 1) { /* verifica parametros recebi<strong>do</strong>s */<br />

printf ("** Erro: Parametro invali<strong>do</strong> **\n");<br />

return (v);<br />

}<br />

for (i=0; i

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

Saved successfully!

Ooh no, something went wrong!