Reading up on how new works in C++ I tried the following code:
#include <iostream>
using namespace std;
struct A { int m; }; // POD
int main()
{
A* a = new A;
cout<<"A m="<<a->m<<endl;
return 0;
}
And the output is always "A m=0". Why doesn't it display a residual value and how can I make it do so?
Additional info: used 5.4.0 20160609 on Ubuntu 16.04. Tried to compile with -std=C++ 03, 98 and 11 standards