我知道NULL总是如此0,但是为什么下面的代码会打印该消息?
NULL
0
#include <iostream> using namespace std; int main() { int* ptr = nullptr; if (ptr == 0) { cout << "Does it always work?"; } return 0; }
c++ nullptr c++11
c++ ×1
c++11 ×1
nullptr ×1