Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The results of allocating zero bytes of memory are implementation-dependent. According to C99 Section 7.20.3 ISO/IEC 9899-1999:

If the size of the space requested is zero, the behavior is implementation-defined: either a NULL pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object.

...