On Sep 5, 12:52 pm, remlostime <remlost...@gmail.comwrote:
now, I define the struct following:
struct node
{
bool match;
node* child[27];
};
What's the difference between
1) node *Trie=new node(); and 2) node *Trie = new node;
new Node() zero initializes the data, i.e. match will be false,
and all of the pointers will be NULL. new Node doesn't; the
contents are undefined, and reading them (before having set them
otherwise) is undefined behavior.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34