prog.c: In function ‘swap’:
prog.c:9:20: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
int (*temp)[5] = m[w1];
^
prog.c:10:9: error: assignment to expression with array type
m[w1] = m[w2];
^
prog.c:11:9: error: assignment to expression with array type
m[w2] = temp;
^
prog.c: In function ‘main’:
prog.c:17:3: warning: braces around scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^~~
prog.c:17:3: note: (near initialization for ‘(anonymous)[0]’)
prog.c:17:32: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:32: note: (near initialization for ‘(anonymous)[0]’)
prog.c:17:34: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:34: note: (near initialization for ‘(anonymous)[0]’)
prog.c:17:36: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:36: note: (near initialization for ‘(anonymous)[0]’)
prog.c:17:38: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:38: note: (near initialization for ‘(anonymous)[0]’)
prog.c:17:3: warning: braces around scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^~~
prog.c:17:3: note: (near initialization for ‘(anonymous)[1]’)
prog.c:17:45: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:45: note: (near initialization for ‘(anonymous)[1]’)
prog.c:17:47: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:47: note: (near initialization for ‘(anonymous)[1]’)
prog.c:17:49: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:49: note: (near initialization for ‘(anonymous)[1]’)
prog.c:17:3: warning: braces around scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^~~
prog.c:17:3: note: (near initialization for ‘(anonymous)[2]’)
prog.c:17:54: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:54: note: (near initialization for ‘(anonymous)[2]’)
prog.c:17:56: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:56: note: (near initialization for ‘(anonymous)[2]’)
prog.c:17:58: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:58: note: (near initialization for ‘(anonymous)[2]’)
prog.c:17:60: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:60: note: (near initialization for ‘(anonymous)[2]’)
prog.c:17:3: warning: braces around scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^~~
prog.c:17:3: note: (near initialization for ‘(anonymous)[3]’)
prog.c:17:67: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:67: note: (near initialization for ‘(anonymous)[3]’)
prog.c:17:69: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:69: note: (near initialization for ‘(anonymous)[3]’)
prog.c:17:71: warning: excess elements in scalar initializer
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:17:71: note: (near initialization for ‘(anonymous)[3]’)
prog.c:17:19: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
int ( *m )[K] = ( int*[] ){ {3,5,1,4}, {0,0,0,0}, {9,9,1,9}, {0,0,0,0} };
^
prog.c:19:9: warning: passing argument 1 of ‘swap’ from incompatible pointer type [-Wincompatible-pointer-types]
swap( m, 0, 2); //zamień wiersz 0 z 2
^
prog.c:6:6: note: expected ‘int (*)[5]’ but argument is of type ‘int (*)[4]’
void swap( int (*m)[5], const int w1, const int w2)
^~~~