|
|
|
|
|
by exDM69
4519 days ago
|
|
Would an assert be any better? I guess you could print out a message to the log and enter an infinite loop if an assertion fails. Similar problems may haunt you when working in kernel space. But still, null pointers are easy compared to other invalid pointers that can not be distinguished by their value. Best practices in C are not as easy to make as in other languages because the environment the code runs in may be anything from a micro controller to an embedded platform to kernel space to modern user space apps. It's not so much about the language as it is about the environment the code runs in. |
|