C++ ifstream error: can't read data : <p>I am trying to read a dataset file(space delimited numbers such as 0.5678) with fstream, but it can't read the dataset and return the same strange value for all data entries</p>

<pre><code>ifstream input_file('Data_file');

for (int j = 1; j &lt;= dimension; j++){
    for (int i = 1; i &lt;= no_of_data_points; i++){
        double x;
        input_file &gt;&gt; x;
        cout &lt;&lt; x &lt;&lt; endl;
    }
}
</code></pre>

<p>The above code returns ,</p>

<pre><code>-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
-9.25596e+61
.........
</code></pre>

<p>I have no idea how to debug it. Can anyone help me?
Thank you!</p>
