Hello!
I'm familarized with Matlab/scilab and other labs programing. So, I've got some dificults to manipulate Array in C.
I need to use in C a instruction which compute, i.e.
But I read in C we need to access all rows and columns.Code:matrix_display(2,:)
So I write this code to "see" a print of array, but output is garbage
Where is my mistake?Code:#include <stdio.h> #include <stdlib.h> #define row_size 10 #define column_size 7 int matrix_display [row_size] [column_size]={ {1,1,1,1,1,1,0},//0 {0,1,1,0,0,0,0},//1 {1,1,0,1,1,0,1},//2 {1,1,1,1,0,0,1},//3 {0,1,1,0,0,1,1},//4 {1,0,1,1,0,1,1},//5 {0,0,1,1,1,1,1},//6 {1,1,1,0,0,0,0},//7 {1,1,1,1,1,1,1},//8 {1,1,1,0,0,1,1},//9 }; int main() { int i,j; for(i=0;i<row_size;i++) { for(j=0;j<column_size;j++) printf(" %d\n", matrix_display[i,j]); } }
Is there a simple way to print all columns which correspond at 1 row?
Thank you
And sorry, this is a rookie question