Relative Content

Tag Archive for c++constructorstructure

Use of default constructor in struct datatype C++

Why do I need to define new Trienode in the following code as the new TrieNode(); when I do it as new TrieNode; it gives segmentation fault. Is there a default constructor for struct datatype that’s important to call here, if so what does it do?

Use of default constructor struct datatype C++

Why do I need to define new Trienode in the following code as the new TrieNode(); when I do it as new TrieNode; it gives segmentation fault. Is there a default constructor for struct datatype that’s important to call here, if so what does it do?