Logo

Programming-Idioms

History of Idiom 26 > diff from v17 to v18

Edit summary for version 18 by :
New C implementation by user [programming-idioms.org]

Version 17

2015-12-30, 17:50:58

Version 18

2016-01-07, 14:11:43

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Code
const int m = 2;
const int n = 3;
double x[m][n];
Comments bubble
This works when the values of m and n are known at compile time.