What does this statement mean ; p=new node;


9/14/2019 4:14:15 PM

Patrick Makashini

1 Answer

New Answer


It means create an object of type node and store it's address in a pointer to type node. The new object is created by new operator, which first allocates (requests) a block of memory of size equal size of node in bytes. If allocation is successful, it calls rhe constructor of class node, once initialization is done it returns the address of the object in memory, the returned address is then stored in a pointer to type node.