Initialisation of Objects Syntax question
- by Brock Woolf
When I initialise a struct in C (Node is the struct):
struct Node
{
/* Non-Relevant code */
};
This works:
Node *rootNode = new Node();
but so does this:
Node *rootNode = new Node;
Is there a difference, and what is the difference between using () or not using the brackets?
Just off memory, I think the same applies above for C++ object initialisations.
What is happening here?