我认为代码是不言自明的:
MyClass* pointer = NULL;
changePointer( pointer );
if (pointer == NULL)
{
// it's entering here :(
}
void changePointer( MyClass* p)
{
MyClass* temp = NULL;
for (int i = 0; i < myContainer.size(); ++i)
{
p = &(myContainer[i]);
if (p == NULL)
{
// it's not entering here :)
}
}
}