Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Pascal

Idiom #26 Create a 2-dimensional array

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

var _x: array[_m,_n] of Double;

m and n need to be constants of type Integer (and declared before the definition of variable x)
X : array (1 .. M, 1 .. N) of Float := (others => (others => 1.0));

New implementation...