If I have a class:
Class aClass
{
vector<aClass> connections;
}
with everything else declared properly, if I were to do:
aClass a = new aClass();
aClass b = new aClass();
b.connections.push_back(a);
would this create a reference to a
or would it duplicate the class.
I would like it to be a pointer to the class but I wasn't sure if I needed extra syntax to ensure this. I remember reading that when a class is declared aClass a = new aClass
it is creating a pointer to the object in the heap but I wasn't sure what would happen here.
For reference this is for something like a linked list.
Also if anyone can think of a better title for this question go ahead and edit it.