I don't clearly understand the difference between the simple instance of an object as:
and instance through new[] operator as:
|
LogicGate * p1 = new LogicGate;
|
In which case I have to use them? And what about the deletion in these different case?
Which technique would be convenient if I have to do 1) , 2) and 3):
1)instatiate a number N of object LogicGate (that has a
vector<LogicGate*>
as member, which has the function of connecting the i-th object of LogicGate to another instatieted object of " LogicGate next_gate" according to some conditions, as it was a wire of a circuit connecting two logic gates), with N depending on a condition?
2) collect these object in some
or another
vector<LogicGate> OR
, depending on gate's type?
3) repeatedly fill and void
vector<bool> input
and
vector<bool> output
in order to test the circuit?
Thank you