title: Reading from file keeps disregarding decimals in float
body: <p>So I am having trouble with the following:</p>
  <p>I save a variable in a config file (it saves exactly fine the whole float number) and when I read the variable from config file it disregards everything after the decimal of the float.</p>
  <p>Example 5.1234 comes out as 5.0000. I must have made some silly mistake which I just cant spot myself so maybe someone with more knowledge can spot it. Thanks!</p>
  <p>I have a struct for Options where I have some default values:</p>
  <pre><code>struct Options
  {
    float b_aX = 4.50f;
     ...
      ...
  
    float* aX = &amp;b_aX;
  }
  </code></pre>
  <p>Then I try to read from the file where I have stored a new value for this variable:</p>
  <pre><code>ifstream file(&quot;c:\\bllaa.cfg&quot;);
  string str;  
  
  float cfg[100] = {};
  int total_lines = 0;
  
      while (getline(file, str)) {
          cfg[total_lines] = std::stoi(str);
          total_lines++;
      }  
   
  //Finally read the value from the file and it comes out ignoring the decimals!
   Options.aX[0] = cfg[0];
  </code></pre>
  <p>In file <code>ax</code> = 5.1234
  After reading from file <code>ax</code> = 5.0000</p>