title: How to make the user enter a positive double variable?
body: <p>I want the user to enter a positive double variable. If they enter anything else, I want the program to loop and continue to ask them to enter a number instead of getting an error and closing. I made an infinite loop with a conditional statement and a break. For some reason if they enter something other than a positive number it infinitely asks for the the radius. Can someone help me with this?</p>
  
  <pre><code>for(;;) {
      cout &lt;&lt; "Radius: ";
      cin &gt;&gt; radius;
      if(radius &gt; 0){
          break;
      }
  }
  </code></pre>