First look at the source code, in the VS2010 environment can not be compiled through, in the VS2013 environment to compile through, and can run, but the results are not the results we expect.
When the object C1 is initially defined by the Mycircle class, the object is allocated memory space,R is not initialized, its value is garbled,pi is 3.1415926,area garbled.
The statement "CIN>>C1.R" is assigned a value of C1.R, assuming 10, and then performing "Cout<<c1.area<<endl", we see that the execution of cout is from memory The value of C1.area in space , this value is determined when defining the object is a garbled value, here will not execute "double area=pi*r*r" statement, so the output is garbled.
If you want to get the correct result, you need a member function, which is calculated in the member function.
C + + Note 007: Easy-to-make error model-why member functions are required in a class