According to this question Unable to print the value of nullptr on screen
I can't print the value of a nullptr since it's of type nullptr_t, and std::cout has no such overload.
But, if you look at this:
int* f()
{
return nullptr;
}
int main()
{
std::cout << f();
}
The output is:
00000000
In this question Why does std::cout output disappear completely after NULL is sent to it they talk about a different problem.
I just want to understand why the std::cout can't print nullptr, but it actually can when nullptr is instead returned by a function.