I put nine digits in the vector but my array comes out with random numbers, I would like my array to come out with the numbers that are in the vector below below my code:
#include <stdio.h>
#include <locale.h>
int vetor [9];
int matriz [3][3];
int i=0, lin=0, col=0, k=0;
main(){
setlocale(LC_ALL, "");
printf("Digite 9 número para uma matriz \n" );
for(i=0;i<9;i++){
scanf("%i", &vetor[i]);
}
for(lin=0;lin<3;lin++){
for(col=0;col<3;col++){
matriz[lin][col] = vetor[k];
k++;
printf("%i\t", &matriz[lin][col]);
}printf("\n");
}
}
What am I doing wrong?