Can anyone tell me what the (char *) is on page 143 kandr2 ? iinning to
understand the tree example but no what I just memtioned.
The only occurrence of the string "(char *)" in page 143 is a cast
applied to the return value of malloc. In the errata to K&R II, they
acknowledge that malloc and it siblings do not need this type of cast.
This code is a carry over from the pre-ANSI days when malloc returned
a char*.
This entire block of code is an implementation of the strdup function
which is used on page 141. Other than the fact that the addtree
function calls strdup, the function is not related to trees at all. It
merely copies the 'source' string (whose address is passed in an
argument) into a dynamically allocated block of memory.