#include <iostream>
#include <fstream>
using namespace std;
int main( )
{
ifstream fin;
ofstream fout;
fin.open("income.dat");
if (fin.fail( ))
{
cout << "Input file opening failed.\n";
exit(1);
}
fout.open("total.dat");
if (fout.fail( ))
{
cout << "Output file opening failed.\n";
exit(1);
}
double next, sum = 0;
int count = 0;
while (fin >> next )
{
sum = sum + next;
count ++;
}
fin.close( );
fout.close( );
cout << "End of program.\n";
return 0;
}
i wan to make a program tat can read all the number in the file.....but it cant .... y?