title: C++ double initialization
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;math.h&gt;
  
  using namespace std;
  
  class circle
  {
  public:
      circle();
      circle(double radius);
      double circlerad(void);
      double area(void);
      double circumference(void);
  
  private:
      double rad;
  
  };
  
  circle::circle()
  {
      double rad = 0;
  }
  
  circle::circle(double radius)
  {
      cout &lt;&lt; radius &lt;&lt; endl;
      double rad = radius;
  }
  
  double circle::circlerad(void)
  {
      return rad;
  }
  
  double circle::area(void)
  {
      double res;
  
      res = rad * rad * 3.14;
  
      return res;
  }
  
  double circle::circumference(void)
  {
      return (double) rad * 2 * 3.14;
  }
  
  double radius(int x1, int y1, int x2, int y2)
  {
      double rad = 0;
  
      double xm, ym;
  
      xm = (double)(x1 + x2) / 2;
      ym = (double)(y1 + y2) / 2;
  
      rad = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
  
      return rad;
  }
  
  int main(void)
  {
      double rad;
      int x1, y1;
      int x2, y2;
  
      cout &lt;&lt; "x1 : ";
      cin &gt;&gt; x1;
      cout &lt;&lt; "y1 : ";
      cin &gt;&gt; y1;
      cout &lt;&lt; "x2 : ";
      cin &gt;&gt; x2;
      cout &lt;&lt; "y2 : ";
      cin &gt;&gt; y2;
  
      *circle one((double)radius(x1, y1, x2, y2));*
  
      cout &lt;&lt; fixed &lt;&lt; one.area() &lt;&lt; endl;
      //cout &lt;&lt; fixed &lt;&lt; one.circumference() &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>this is my code to calculate circle area and circumference.</p>
  
  <p>But the problem is that when I initialize circle one, regardless of radius(x1, y1, x2, y2) value,</p>
  
  <p>it always initialize to -9.2559631349317831e+061.</p>