Skip to main content
7 events
when toggle format what by license comment
Feb 27, 2021 at 21:03 vote accept Neil
Dec 2, 2018 at 22:59 history edited Edward CC BY-SA 4.0
added 72 characters in body
Dec 2, 2018 at 22:56 comment added Edward Fair enough -- I've updated my answer to be more technically correct. Also see c-faq.com/null/nullor0.html
Dec 2, 2018 at 22:37 comment added Neil Thanks! Comment on your 1st point: I agree that the address 0 is not always a null pointer, and memset(pointer, 0, sizeof pointer) (ie, int 0) is not a way to get a null pointer. However, in pointer contexts, 0 is a null pointer, "The macro NULL is an implementation-defined null pointer constant, which may be an integer constant expression with the value ​0​." c-faq.com/null/null2.html. (Although stylistically, it may be better to use NULL.)
Dec 1, 2018 at 22:17 comment added Edward Further background for the curious: c-faq.com/null/machexamp.html
Dec 1, 2018 at 22:04 comment added Edward Yes, it's a possibility but not guaranteed by the standard: stackoverflow.com/questions/9894013/is-null-always-zero-in-c
Dec 1, 2018 at 20:45 history answered Edward CC BY-SA 4.0