Re: Ike Naar

Discussion in 'C Programming' started by Antoninus Twink, Feb 8, 2009.

  1. On 8 Feb 2009 at 0:59, Han from China wrote:
    > Anyway, the classic Unix case is the execl() function. If NULL is
    > defined as ((void *) 0), the unadorned NULL works, but if NULL
    > is defined as 0, we have the problem you mention.


    You're right, of course.

    However, /most/ sets of standard library headers that you're likely to
    run across will be set up to work both in C and C++, so it's /likely/
    that they'll choose to include the cast (which is needed in C++), so
    it's /likely/ that the code will work just fine.

    But I agree, putting in the cast explicitly is good practise.
    Antoninus Twink, Feb 8, 2009
    #1
    1. Advertising

  2. Antoninus Twink <> writes:

    > On 8 Feb 2009 at 0:59, Han from China wrote:
    >> Anyway, the classic Unix case is the execl() function. If NULL is
    >> defined as ((void *) 0), the unadorned NULL works, but if NULL
    >> is defined as 0, we have the problem you mention.

    >
    > You're right, of course.
    >
    > However, /most/ sets of standard library headers that you're likely to
    > run across will be set up to work both in C and C++, so it's /likely/
    > that they'll choose to include the cast (which is needed in C++), so
    > it's /likely/ that the code will work just fine.


    You'd have to post that to comp.lang.C++ to see why it is quite the
    other way round. Nice try, though, to get a good C++ argument going
    here!

    --
    Ben.
    Ben Bacarisse, Feb 8, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    247
    Mark -Mortakai- Moran
    Sep 11, 2008
  2. Keith Thompson

    Re: Ike Naar

    Keith Thompson, Feb 8, 2009, in forum: C Programming
    Replies:
    5
    Views:
    351
    Richard Bos
    Feb 23, 2009
  3. Stephen Sprunk

    Re: Ike Naar

    Stephen Sprunk, Feb 8, 2009, in forum: C Programming
    Replies:
    31
    Views:
    881
    Keith Thompson
    Feb 15, 2009
  4. Replies:
    1
    Views:
    101
    Mark -Mortakai- Moran
    Sep 11, 2008
Loading...

Share This Page