I just wanted to confirm the difference here, take this as an example:
class Gate
{
public:
Gate(); //Constructor
void some_fun();
private:
int one, two;
ptr p1;
Gate* next;
};
typedef Gate* ptr;
Gate::Gate()
{
one = 0;
two = 0;
}
void Gate::some_fun()
{
p1 = new Gate;
p1 = p1->next;
p1 = new Gate();
}
In my example, I have created 2 new nodes of "Gate" and the only difference between them is that the first node does not have the variables "one and two" initialized, while the second one does.