3 ms·
Thanks for pointing out the updated man page. This is much better. But the another question is how developers are supposed to know which node is the root node,
by cee-studio 6y ago
Thanks for pointing out the updated man page. This is much better. But the another question is how developers are supposed to know which node is the root node, which is supposed to be opaque.
- geophile 6y agoYou have to know the root of the tree to do anything: void *tsearch(const void *key, void **rootp, int (*compar)(const void *, const void *)); void *tfind(const void *key, void *const *rootp, int (*compar)(const void *, const void *)); ... rootp points to a variable which points to the root of the tree. You can't operate on a tree unless you have a pointer to it, i.e., it's root.