I wonder about "cout" nullptr doesn't work. It work only once. But "printf" work on the main function.
#include <iostream>
int main() {
const char *np=nullptr;
std::cout << "np: "<<np<<std::endl;
std::cout << "np: "<<np<<std::endl;
std::cout << "np: "<<np<<std::endl;
printf("printf np:%s\n",np);
std::cout << "np: "<<np<<std::endl;
std::cout << "np: "<<np<<std::endl;
}
It work like below.
np: printf np:(null)