Hello ok the scope of this program I need to go to a file open and bring some doubles from that file into and array this is what I got so far and it says I retrieved 0 files hmmm if anyone can help I would appreciate it....
[code=cpp]
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <fstream>
using namespace std;
int main ()
{
const int SIZE = 150;
double data [SIZE];
double input;
int index = 0;
ifstream fin;
fin.open ("data07.fp100. ");
while ( fin >> input )
{
data [ index++ ] = input;
if ( index >= SIZE ) break;
}
fin.close( );
cout << "\n" << index << " fp numbers were read from disk file.";
for ( int i = 0; i < index; ++i )
{
if ( i % 5 == 0 ) cout << "\n";
cout << setw (14) << data [ i ];
}
}[/code]
[code=cpp]
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <fstream>
using namespace std;
int main ()
{
const int SIZE = 150;
double data [SIZE];
double input;
int index = 0;
ifstream fin;
fin.open ("data07.fp100. ");
while ( fin >> input )
{
data [ index++ ] = input;
if ( index >= SIZE ) break;
}
fin.close( );
cout << "\n" << index << " fp numbers were read from disk file.";
for ( int i = 0; i < index; ++i )
{
if ( i % 5 == 0 ) cout << "\n";
cout << setw (14) << data [ i ];
}
}[/code]
Comment