I want to initalize a 3 x 3 matrix with first two rows as 0\'s and last row as 1\'s. I have declared a 2D array int matrix[3][3]
int matrix[3][3]
I want to initialize it wit
matrix[0][2] = matrix[0][1] = matrix[0][0] = matrix[1][2] = matrix[1][1] = matrix[1][0] = 0; matrix[2][2] = matrix[2][1] = matrix[2][0] = 1;
or
#include ... memset(matrix, 0, sizeof(matrix)); matrix[2][2] = matrix[2][1] = matrix[2][0] = 1;