Doubt in code implementation

here while creating an object of class trienode why do we have to give node *n= new trienode(). it is givin error if i am not using the parenthesis brackets.

sorry, trienode *n=new trienode()

you have to give brackets as you are calling the trienode constructor.
hope its clear if yes dont forget to hit like and mark resolved :smiley:

but even if we have not created any default constructor, then why is there a need for brackets?

@Akshita99 its syntax you have to use brackets otherwise it will give error as you see. whenever creating new node type brackets is necessary

do we have to do it in case of all objects we create with the help of new regardless of whats the type of class?

matlab yahan node type ka banaya h isliye aisa kiya yaa koi bhi type ki class ho toh brackets lgane padenge?

Akshita yes you can say that. when you are forming some type of new node brackets are required. but if you simply form a class pair then can declare pair p and use directly.

okay thank you .

you are welcome just mark it resolved