MCPcopy Create free account
hub / github.com/ShiqiYu/CPP / main

Function main

week04/examples/md-array.cpp:15–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15int main()
16{
17 int mat1[2][3] = {{11,12,13}, {14,15,16}};
18
19 int rows = 5;
20 int cols = 4;
21 //float mat2[rows][cols]; //uninitialized array
22 float mat2[rows][4]; //uninitialized array
23
24 //init_2d_array(mat2, rows, cols);
25
26 for (int r = 0; r < rows; r++)
27 for(int c = 0; c < cols; c++)
28 mat2[r][c] = r * c;
29
30
31 for (int r = 0; r < rows; r++)
32 {
33 for(int c = 0; c < cols; c++)
34 cout << mat2[r][c] << " ";
35 cout << endl;
36 }
37 return 0;
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected