You can use arrays and initialize the array when you declare it. For example:
int list [] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
to read the value in the array element you subscript, like:
int i;
int index
.
.
i = list [4];
which gives you the fifth element (loved that movie) of the array and assigns it to i.
You could use a variable for the index if you needed to read in a loop.
In order to group your points you could use three separate arrays with the x, y and z values in each one or create a structure.
struct points {
int x;
int y;
int z;
};
To create an array of these and initialize them in triads you'd do something like
struct points plist [] = {
{4, 5, 6},
{-1, 3, 9},
{23, 46, 92}
};
You can also initialize them without the inside curly braces but putting the braces in helps to keep things straight for you. You would address the x, y and z values thus:
plist[i].x;
plist[i].y;
plist[i].z;
Where
i is your index into the list. I believe that more recent incarnations of the c/c++ language would automatically make "points" a new data type and you really wouldn't need to place the keyword "struct" in front of points when declaring an instance of points.
You can also mix data type within a structure, including character arrays and character pointers.
struct Character {
char *type;
int strength;
int dexterity;
};
Character Morgo = {"Elf", 5, 15};
Lilith, Night Butterfly