Segmentation fault (core dumped) in matrix data scanf

Asked

Viewed 118 times

0

This following piece of error code, does not read user data to allocate in 5x2 matrix, can not find the problem

 int linha=0, coluna=0;
    int matriz[5][2];


    for(linha=0;linha < 5; linha++){
        for(coluna=0;coluna < 2; coluna++){
        scanf("%i", matriz[linha][coluna]);
        }
        printf("\n");
    }
  • 3

    scanf("%i", &matriz[linha][coluna]); or scanf("%d", &matriz[linha][coluna]);

  • Ah yes, it is true, that lack of attention to mine. Thank you very much

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.