Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes. The code is equivalent, but it's clear that the second is meant to optional.

The first has no such indication, except hopefully some human-readable comment that the pointer may be NULL.



> The first has no such indication, except hopefully some human-readable comment that the pointer may be NULL.

I don't understand. If the parameter was not meant to be sometimes null it would be a reference; not a pointer. The fact that a pointer is used is the "this may be null" indication.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: