Finding a Pointer to NULL
问题 I have int* foo[SIZE] and I want to search it for the first element that points to NULL . But when I do this: std::find(foo, foo + SIZE, NULL) I get the error: error C2446: '==' : no conversion from 'const int' to 'int *' Should I just be using static_cast<int*>(NULL) instead of NULL ? C++11 solves this via nullptr but that's not an option for me in C++03 回答1: tl;dr: Use nullptr , or define your own equivalent. The problem is that NULL is some macro that expands to an integral constant