array initialization

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Herbert Rosenau

    #16
    Re: array initialization

    On Fri, 25 Aug 2006 03:03:11 UTC, Eric Sosman
    <esosman@acm-dot-org.invalidwrot e:
    assiss wrote:
    >
    int *list[6] = {NULL};
    list[0]=NULL, then the other 5 elements will be initialized with 0.

    ONLY if you are sure that NULL equals to 0.
    On any conforming C compiler NULL will like 0 or '\0' or 0x00 or 000
    simply expand to a null pointer constant in that context. That is NOT
    0.
    >
    I am sure that NULL equals 0. Always. On every
    Standard-conforming C implementation ever built. Amen.
    >
    No, noways. It will always expand to an null pointer constant. There
    is a difference.

    --
    Tschau/Bye
    Herbert

    Visit http://www.ecomstation.de the home of german eComStation
    eComStation 1.2 Deutsch ist da!

    Comment

    Working...