#include // Elements in a row are consecutive // But compiler needs to know how many columns there are per row, // so it knows how to skip to the i th row void modify(int rows, int cols, int c[][cols]) { int i,j; for (i=0; i < rows; i++) { for (j=0; j < cols; j++) { c[i][j] = 10*i+j; } } } int main() { int rows = 3; int cols = 3; int c[rows][cols]; int i,j; for (i=0; i < rows; i++) { for (j=0; j < cols; j++) { c[i][j] = 0; } } modify(i,j,c); for (i=0; i < rows; i++) { for (j=0; j < cols; j++) { printf("%4d ", c[i][j]); } printf("\n"); } return 0; }