3 ms·
The null address isn't necessarily 0. When a literal 0 is assigned to a pointer it can be magically changed to a platform's true null. Memset() doesn't have thi
by kevin_thibedeau 4y ago
The null address isn't necessarily 0. When a literal 0 is assigned to a pointer it can be magically changed to a platform's true null. Memset() doesn't have this behavior. This isn't relevant on any modern systems but it is an affordance of the C standard. That is the true significance of nullptr. It obsoletes the magic 0 literals.
- IshKebab 4y agoSure but on what modern platform isn't null equal to 0? Do modern C standards need to support hardware that no longer exists and will likely never exist?
- userbinator 4y agoJust like with undefined behaviour, IMHO the C standards are deliberately underspecified to allow the language to remain applicable to just about any feasible computer.