Created
September 22, 2013 17:27
-
-
Save reinaldorauch/6662031 to your computer and use it in GitHub Desktop.
Função que tento deixar variável a segunda dimensão da matriz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Função para imprimir um array de 2 dimensões e de inteiros | |
* @param matriz A matriz à ser imprimida | |
* @param x tamanho de colunas da matriz | |
* @param y tamanho de linhas da matriz | |
*/ | |
void imprime_matriz_int(int matriz[][4], int x, int y) { | |
int i, j; | |
// itera sobre as colunas da matriz | |
for (i = 0; i < x; i++) { | |
printf("i: %d\n", i); | |
// Imprime a linha de separação entre as linhas | |
imprime_linha_variavel(y); | |
// Imprime a linha propriamente dita da matriz | |
for (j = 0; j < y; j++) { | |
printf("| %7d ", matriz[i][j]); | |
} | |
puts("|"); | |
} | |
imprime_linha_variavel(y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment