4 ms·
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 commen
by paulddraper 7y ago
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.
- jcelerier 7y ago> 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.