Re: array of unknown length in a class
I don't know what larger problem you are trying to solve. But to me it seems just having a node class is fine.
Code:
class Node {
public:
Node* othernodes[MAX_CONNECTIONS]
}
// Or ...
class Node{
public:
Node** other_nodes; // This requires new/delete to resize as necessary
}
// I would preffer below
class Node{
public:
vector<Node*> other_noes;
}
Perhaps try solving simpler problems in C++, that you could word well first. This way you will have more experience points and gain enough levels to attack a larger problem like this more easily.
01101000011001010110110001101100011011110010000001110011011001010111100001111001