I tried memset like
struct TreeNode {
bool exist;
bool word_ending;
TreeNode* branches[3];
TreeNode(): exist(true), word_ending(false) {
memset(branches, NULL, sizeof(branches));
}
};
but there appears warnings
warning: implicit conversion of NULL constant to 'int' [-Wnull-conversion]
memset(branches, NULL, sizeof(branches));
~~~~~~ ^~~~
0
1 warning generated.
Is there some other way to initialize the array of pointer to NULL?
TreeNode* branches[3] = {};in the declaration.