I am trying to figure out a run-time exception I get on line 53 below. I am trying to create a new Node object using a pointer to an array of Node*. The Node* are all initialized to 0 in the constructor. Can anyone spot the error?
The run-time exception is:
Unhandled exception at 0x00df249f in LAN.exe: 0xC0000005: Access violation writing location 0xcccccccc.
I don't see how this could be causing the problem. In main() I only add one node and node_count is initialized to 0, while capacity is initialized to 10; I have verified those value in the debugger just before line 53 executes. I can understand this being a problem for the 11th node, but not the first 10.
I need to see the implementation of Node, but I already see a problem with Network::Network(). Constructors can't be called. I don't know how that compiled at all.