Question 11.26

What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?


The ANSI/ISO Standard says that it may do either; the behavior is implementation-defined (see question 11.33).

References: ANSI Sec. 4.10.3
ISO Sec. 7.10.3
PCS Sec. 16.1 p. 386


Read sequentially: prev next up top


This page by Steve Summit // Copyright 1995 // mail feedback