1 /* Copyright 2022-2023 Free Software Foundation, Inc.
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 int array_3d
[5][5][5];
26 int array_3d9
[6][6][6];
29 for (i
= 0; i
< sizeof (array_1d
) / sizeof (int); i
++)
31 for (i
= 0; i
< sizeof (array_1d9
) / sizeof (int); i
++)
32 *(array_1d9
+ i
) = i
% 6 == 5 ? 9 : 1;
33 for (i
= 0; i
< sizeof (array_2d
) / sizeof (int); i
++)
35 for (i
= 0; i
< sizeof (array_2d9
) / sizeof (int); i
++)
36 *(*array_2d9
+ i
) = i
/ 6 == 5 || i
% 6 == 5 ? 9 : 2;
37 for (i
= 0; i
< sizeof (array_3d
) / sizeof (int); i
++)
38 *(**array_3d
+ i
) = 3;
39 for (i
= 0; i
< sizeof (array_3d9
) / sizeof (int); i
++)
40 *(**array_3d9
+ i
) = i
/ 6 / 6 == 5 || i
/ 6 % 6 == 5 || i
% 6 == 5 ? 9 : 3;
42 printf("\n"); /* Break here */
43 for (i
= 0; i
< sizeof (array_1d
) / sizeof (int); i
++)
44 printf(" %d", *(array_1d
+ i
));
46 for (i
= 0; i
< sizeof (array_1d9
) / sizeof (int); i
++)
47 printf(" %d", *(array_1d9
+ i
));
49 for (i
= 0; i
< sizeof (array_2d
) / sizeof (int); i
++)
50 printf(" %d", *(*array_2d
+ i
));
52 for (i
= 0; i
< sizeof (array_2d9
) / sizeof (int); i
++)
53 printf(" %d", *(*array_2d9
+ i
));
55 for (i
= 0; i
< sizeof (array_3d
) / sizeof (int); i
++)
56 printf(" %d", *(**array_3d
+ i
));
58 for (i
= 0; i
< sizeof (array_3d9
) / sizeof (int); i
++)
59 printf(" %d", *(**array_3d9
+ i
));