please help me understand the folowing code....
class A {
int a;
public:
A() : a ( 0 ) {}
int get() {
cout << "Hello WOrld " << endl;
return 0;
}
};
int main( int argc, char** argv )
{
cout<< ((A*)3)->get() << endl;
return 0;
}
this code runs! and prints the correct output if i return zero in get() function,, but when i return a it throws an exception ( i think becuase a is not initialized, infact not constructed ), but this code runs ......no idea:eek: