#include <iostream>
int main() {
int* pt;
std::cout << pt << std::endl;
if(pt)
std::cout << "true" << std::endl;
else
std::cout << "false" << std::endl;
return 0;
}
This code fragment evaulate to false. What is more it prints 0 in
std::cout << pt << std::endl;
I thought that uninitialized pointers points to some random address, which may contain garbage value. In this case it points to 0 value like i would assign it to nullptr. Could someone clarify this for me?