Logo

Programming-Idioms

History of Idiom 26 > diff from v70 to v71

Edit summary for version 71 by ThinkingHorse:
[C] Just put back what was there.

Version 70

2020-04-23, 08:08:18

Version 71

2020-04-23, 08:09:43

Idiom #26 Create a 2-dimensional array

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

Illustration

Idiom #26 Create a 2-dimensional array

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

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