In article <c6*************************@posting.google.com> ,
<mo*****@yahoo.com> wrote:
I'm working to learn C. I've into a problem that I'm not sure how to
solve. I'm implementing a basic binary tree but I don't want it to be
restricted to a particular data type. I seemed to be able to get
around this by making the data type stored a pointer to void. But then
this introduces the problem that I can't compare the values being
pointed to. Can anyone give me any tips?
Let the user give you a comparison function, the way qsort and bsearch do.
For bonus points, use a comparison function with the same interface,
so the same function can be used for all three.
dave
--
Dave Vandervies
dj******@csclub.uwaterloo.ca
80% of all questions that begin with the word 'why' can be answered
with the simple sentence 'people are stupid.'
--Shamelessly Stolen From Mike in uw.general