Re: Something wrong in my program

From: Peter Nilsson (airia_at_acay.com.au)
Date: 01/18/04


Date: Sun, 18 Jan 2004 20:15:55 +1100


"Mark McIntyre" <markmcintyre@spamcop.net> wrote in message
news:dvqg0059ur2hpcbhvo542f51edraf27hhk@4ax.com...
> ... void* converts implicitly to any other pointer type.

That's not true in the case of function pointers. Apart from null pointers,
the conversion in such cases is undefined. [C99 J.5.7 notwithstanding.]

--
Peter


Relevant Pages

  • Re: can the member function be compared?
    ... void Func1() ... If two pointers point to nonstatic data members of the ... 5.9/1 The operands shall have arithmetic, enumeration or pointer type. ...
    (microsoft.public.vc.language)
  • Re: sizeof(ptr) = ?
    ... A void * has the same representation as a char *. ... Char pointers which require additional data ... iff the default offset is 0. ...
    (comp.lang.c)
  • Re: Malloc code
    ... int xxx; ... As for not using the void pointer, I will have to do some further testing ... I just needed some insight on passing arrays of pointers. ... struct MCB *r1; ...
    (microsoft.public.vc.language)
  • Re: easy pointers to functions problem
    ... I am trying to get an idea of how function pointers work. ... you cannot pass a function pointer as a void* parameter. ... This is different to your prototype of do_stuff above, ...
    (comp.lang.c)
  • Re: polymorphic design approach
    ... > polymorphism. ... * 'Device' pointers are stored so as to allow polymorphic ... virtual void handleMessage ...
    (alt.comp.lang.learn.c-cpp)