std :: vector will do this.
t
class Node
{
std::vector< NODE > mNodes;
public:
int x, y;
Node& operator( int i )
{
return mNodes[i];
}
}
Now, if you have a Node defined as n, you can access the ith Node stored in this Node as follows:
Node n;
int x = n( 12 ).x;
int y = n( 14 ).y;
source
share