Commenting and uncommenting the following statement, with significant differences in results. I am a C++ rookie, and I am very confused at this problem. I use Visual Studio 2015 Enterprise and Windows 10 64bit.
class Test
{
private:
double d;
float f;
int i;
int *pt;
//Commenting and uncommenting this statement, with significant differences in results.
std::shared_ptr<int> spt;
};
int main(int argc, char** argv)
{
Test t;
return 0;
}
When commented, the result:
t {d=-9.2559631349317831e+61 f=-107374176. i=-858993460 ...} Test
d -9.2559631349317831e+61 double
f -107374176. float
i -858993460 int
pt 0xcccccccc {???} int *
When uncommented, the result:
t {d=0.00000000000000000 f=0.000000000 i=0 ...} Test
d 0.00000000000000000 double
f 0.000000000 float
i 0 int
pt 0x00000000 {???} int *
spt empty std::shared_ptr<int>