title: c++ double initialization- default values?
body: <p>I'm debugging some c++ code, and have come across a double that never appears to have been given a value. It is declared with the line</p>
  
  <pre><code>double x;
  </code></pre>
  
  <p>Having not used c or c++ much before, I'm unsure whether doubles have a value that they default to? I.e. Given the declaration above, if x is never specifically given a value, will it automatically be 0, or will it be null?</p>
  
  <p>X is used in a calculation elsewhere in the code, and the result of the calculation is meant to be displayed to the user- at the moment it's not... The calculation is:</p>
  
  <pre><code>y*asin(sin(x/y)*sin(a*b));
  </code></pre>
  
  <p>I would assume that if x defaults to 0, this would cause a compile/runtime error? If x defaults to 0, surely the calculation would return 0, and 0 would be displayed to the user?</p>