Is it possible to declare an array consisting of other arrays (with variable sizes) consisting of structs in C++? It would be really nice if there was an easy and efficient way (using for) to iteration over all structs inside an element of the array.
The struct is defined like this:
struct Number
{
int x;
int y;
};
For example, the data is something like:
{
{ {0,0}, {0,1} },
{ {0,0}, {0,1}, {1,0}, {0,0} },
{ {0,0}, },
{ {0,0}, {4,0} }
}
I would like to use this for a self made clock consisting of an Arduino Uno, an Ethernet shield, an RTC and a LED array. The solution shouldn't use more memory than needed. That's why I don't use a two dimensional array.
Yes, Number* var[];
or Number** var;
. Case closed :)
EDIT: oh, you swapped to C++... Than save yourself a headache and use the std::vector. Well... you can make your own Vector even in C, but no templates.