
casting void pointer to be a pointer to a function
Quote:
Bhattacharya) writes:
|> >But there is a more serious problem ...
|> >
|> >
|> >Yes, this is the problem. void* is big enough to point to any `object'
|> >whatsoever: but it is not necessarily big enough to point to a function.
|>
|> This is new to me, so I picked my C-Bible (K&H) and read "Pointer to
functions".
|> There I find: "...Every pointer can be transformed to void * and vice
versa without
|> loosing information ..." (This is a re-translated sentence from the german
version).
The statement is wrong. Christianity may be defined by the bible (in
paractice, even that is not true), but C is defined by the ANSI C standard
and the interepretation rulings.:-)
|> I think this is logical. Otherwise there would be no possibilty to declare
library
|> functions like qsort().
How will you get an array of functions to pass to qsort in the first place?
Think before you write.
Cheers
Tanmoy
--
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
<http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]