title: converting a string into a double
body: <p>I am looking for a way to get floating point input from a user.</p>
  
  <p>My way of going about this is to use a self-made getstrn function and plug that into another function which would convert the string into a double.</p>
  
  <p>My safe get string:</p>
  
  <pre><code>void safeGetString(char arr[], int limit){
      int c, i;
      i = 0;
      c = getchar();
      while (c != '\n'){
          if (i &lt; limit -1){
              arr[i] = c;
              i++;
          }
          c = getchar();
      }
      arr[i] = '\0';
  }
  </code></pre>
  
  <p>What would be the best way to write this get_double function?</p>