The same code is giving me two different outputs when I run it in two different places. This is the code;
#include <iostream>
using namespace std;
struct test {
int val;
};
int main() {
test* a;
cout << (a == NULL) << endl;
}
I get either 1 as the output:
or 0:
So, does an undefined pointer variable equals to NULL or not? What could be the reason for this variance?