J
John C
Hi, I am a little uncertain about the concept of passing a reference to a
class to another instance of a class. for instance I thought that the
following was ok:
Network network = Network();
Population pool = Population(& network);
.... but this doesnt seem to work.. however the following works...
Network * network = new Network();
Population pool = Polulation( network );
Can someone tell me what the difference between the two are. I think i am
still getting confused when i should be using 'new' or now, i.e.:
1) Object ball = Object();
2) Object * ball = new Object();
Any help and insight would be much appreciated!
Cheers,
John
class to another instance of a class. for instance I thought that the
following was ok:
Network network = Network();
Population pool = Population(& network);
.... but this doesnt seem to work.. however the following works...
Network * network = new Network();
Population pool = Polulation( network );
Can someone tell me what the difference between the two are. I think i am
still getting confused when i should be using 'new' or now, i.e.:
1) Object ball = Object();
2) Object * ball = new Object();
Any help and insight would be much appreciated!
Cheers,
John