K
Kenneth Brody
Dan Pop wrote:
[...]
Am I correct that all-bits-zero is not necessarily the same as NULL?
In other words, this is not guaranteed to get a set of 10 NULL pointers
(assuming the calloc succeeds):
char **pointers = calloc(10,sizeof(*pointers));
--
+---------+----------------------------------+-----------------------------+
| Kenneth | kenbrody at spamcop.net | "The opinions expressed |
| J. | http://www.hvcomputer.com | herein are not necessarily |
| Brody | http://www.fptech.com | those of fP Technologies." |
+---------+----------------------------------+-----------------------------+
[...]
Well written C code always uses NULL, because it expresses the
programmer's intentions better than any explicit null pointer constant.
After all, this is why this macro was introduced in the first place.
Am I correct that all-bits-zero is not necessarily the same as NULL?
In other words, this is not guaranteed to get a set of 10 NULL pointers
(assuming the calloc succeeds):
char **pointers = calloc(10,sizeof(*pointers));
--
+---------+----------------------------------+-----------------------------+
| Kenneth | kenbrody at spamcop.net | "The opinions expressed |
| J. | http://www.hvcomputer.com | herein are not necessarily |
| Brody | http://www.fptech.com | those of fP Technologies." |
+---------+----------------------------------+-----------------------------+