Your question is unclear, but I think that you're trying to set the value of the
correct field in a note to true.
First of all, this line doesn't work:
bool answer = top_of_node -> children -> correct = true ;
This is essentially
a=b=c; chain assignments are not valid in c.
Now, say that you have a node, called foo, and memory has been allocated to it. To set
correct to true, just do this:
foo->correct = true;
Inserting a node into the trie is another story. In your code above, you've created the root node, but then the code is trying to set a value in a child that doesn't exist yet. That will generate an error. You need to insert the child node first.
The following is a revised version of your code that shows how to insert a child in a particular location, children, in the root node. It also shows how to print the value of the bool directly without using an intermediate variable.
top_of_node = malloc(sizeof(node));
top_of_node->children = malloc(sizeof(node));
top_of_node -> children -> correct = true ;
printf("DIRECT true or false (1 or 0 ) = %d\n ",top_of_node -> children -> correct);
bool answer = top_of_node -> children -> correct;
printf("true or false (1 or 0 ) = %d\n ",answer);
Of course, this doesn't demonstrate how to walk a trie or step from parent to child. You should review the video shorts on trees and tries.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)