need C help
Henry, if I understand you correctly, you want to "initialize" a large
multi-dimensional array with data known at compile-time. You don't
want to read the data from a diskfile, you want it to be in your
program code.
That means you use:
int ar[100] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11,12,13,14,15,16,17,18,19, 20 …
… ,93,94,95,96,97,98,99,100} ;
if you wanted to initialize ar to be an array of counting numbers and didn't
like loops.
If you wanted:
1 6 8
7 4 2
3 9 5
in a 3 x 3 array, you'd have:
int ar[3][3] { 1, 6, 8, 7, 4, 2, 3, 9, 5} because C arrays are stored
in Row Major Order.