title: Unable to use stringstream to read in int and double
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;sstream&gt;//for istringstream
  
  int main(){
      
      std::istringstream iss;
      std::string tempSTR;
      int A;
      double B;
      std::cout&lt;&lt;&quot;Please enter an int.\n&quot;;
      std::cin&gt;&gt;tempSTR;
      iss.str(tempSTR);
      iss&gt;&gt;A;
      std::cout&lt;&lt;&quot;A = &quot;&lt;&lt;A&lt;&lt;&quot;\n&quot;;
      std::cout&lt;&lt;&quot;Please enter a double.\n&quot;;
      std::cin&gt;&gt;tempSTR;
      iss.str(tempSTR);
      iss&gt;&gt;B;
      std::cout&lt;&lt;&quot;B = &quot;&lt;&lt;B&lt;&lt;&quot;\n&quot;;
  
      std::cout&lt;&lt;&quot;\nEND OF PROGRAM. GOODBYE!\n\n&quot;;
  }//end of main
  </code></pre>
  <p>Code is simple enough but it just won't work. I just need to use a string stream to read in an int and then a double. Reading in the int first works but the double just gets outputted as zero. What am I doing wrong?</p>