We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NULL
((void*)0)
nullptr 出现的目的是为了替代 NULL。在某种意义上来说,传统 C++ 会把 NULL、0 视为同一种东西,这取决于编译器如何定义 NULL,有些编译器会将 NULL 定义为 ((void*)0),有些则会直接将其定义为 0。
void*
应该改为
nullptr 出现的目的是为了替代 NULL。C++ 可能会把 NULL、0 视为同一种东西,这取决于编译器如何定义 NULL,宏 NULL 是由实现定义的空指针常量。而值为零的整数字面量就是空指针常量。
The text was updated successfully, but these errors were encountered:
同时还存在的问题是 NULL 并不是编译器定义的。
Sorry, something went wrong.
区分标准库(如主流 libstdc++、MSVC STL、libc++)与编译器,对于不少人来说还是过于复杂了。很多表述的确不严谨,能修改自然更好。
Successfully merging a pull request may close this issue.
void*
,但这在 C++ 中不允许,因为空指针常量不能具有该类型。这是明确规定的。应该改为
The text was updated successfully, but these errors were encountered: