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

Only the first two expressions on the right are null pointer constants (integral constant expression with a value of 0, optionally cast as a void *), that can be used to initialize all pointer variables, including function pointers. The last one is merely a null pointer (to void), that can't be implicitly converted to a pointer to a function.

C++ has stricter rules for null pointer constants, and thus only the first version is valid C++.



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

Search: