Actual source code: example6.edp
 1 /*******************************************************
 2  *  This file is part of the FreeFEM tutorial made by  *
 3  *      Pierre Jolivet <pierre@joliv.et>               *
 4  *                                                     *
 5  *  See https://joliv.et/FreeFem-tutorial for more     *
 6  *                                                     *
 7  *   Description: definition and manipulation          *
 8  *                of arrays                            *
 9  *******************************************************/
 
11 real[int] A(4);
12 A = 1;
13 real [int] B;
14 B.resize(5);
15 B = 1:5;
 
17 complex[int, int] C(4, 8);
18 for(int i = 0; i < 4; ++i) {
19     C(i, :) = i + 1.0 + 1i * 3.0;
20 }
 
22 int[int][int] D(3);
23 for(int i = 0; i < 3; ++i) {
24     D[i].resize(5 + i);
25     D[i] = 2.0 + i;
26 }
 
28 matrix[int] E(4);
29 E.resize(2);
30 cout << C.n << " " << C.m << endl;
31 string[int] F(2);
32 F[0] = "foo";
33 F[1] = "bar";