I am working my way through "thinking in c++" volume 1, and have come across something I do not think I understand completely:
In the implementation of the member function push() below, there is this line of code:head = new Link(dat, head);
I understand that it is allocating space on the heap for a new object(structure) of type Link. As far as I understand, "head" is a pointer to Link, so that this line of code would assign the address of the new Link object to "head". What I don't really understand is what is happening inside the parenthesis: "new Link(dat, head)".I don't see how you can make a new object(structure) of type Link and just change the last parameter ? I would have expected simply a : "head = new Link;", and then initialization of the members of struct Link. Can someone please explain it to me ??? Please??