title: may be used uninitialized in this function [-Wmaybe-uninitialized]
body: <p>I need help regarding to this message: " warning: ‘f_0’ may be used uninitialized in this function [-Wmaybe-uninitialized]" </p>
  
  <p>I have a file name: "shen_test_38_30_60__78_26_38_b_100_ch1-683.0-mhz-8000.0-ksps-2016-06-20-17.24.19-utc.dat";</p>
  
  <p>and I want to get a values: "683" and "8000" by using scan and convert string to number, such as:</p>
  
  <pre><code>void split(const string&amp; s, char c, vector&lt;string&gt;&amp; v) {
     string::size_type i = 0;
     string::size_type j = s.find(c);
  
     while (j != string::npos) {
        v.push_back(s.substr(i, j-i));
        i = ++j;
        j = s.find(c, j);
  
        if (j == string::npos){
           v.push_back(s.substr(i, s.length()));
        }
     }
  }
  int main()
  {
       string input_file_name1 = "shen_test_38_30_60__78_26_38_b_100_ch1-683.0-mhz-8000.0-ksps-2016-06-20-17.24.19-utc.dat";
       split(input_file_name1, '-', v);
  
              for(double i=1; i &lt; v.size(); i++)
              {
                  if(v[i] == "mhz"){
                      f_0 = atoi(v[i-1].c_str())*1e6;                 cout &lt;&lt;"***f_0      = " &lt;&lt; f_0 &lt;&lt; endl;
                  }
                  if(v[i] == "ksps"){
                      f_s = atoi(v[i-1].c_str()) * 1e3;               cout &lt;&lt; "***f_s         = " &lt;&lt;f_s &lt;&lt;endl ;
                  }
  
              }
  }
  </code></pre>
  
  <p>double t1 = f_s + 10000;
  double t2 = f_0 + 53000000;</p>
  
  <p>it really give me a real number but when I try to do some calculation, it showed the error message: "warning: ‘f_0’ may be used uninitialized in this function [-Wmaybe-uninitialized]"</p>
  
  <p>any ideal , please help!</p>
  
  <p>Thank you.</p>