#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main( )
{
ifstream fin;
ofstream fout;
fin.open("income.dat");
fout.open("total.dat");
char income;
fin.get(income);
while (! fin.eof())
{
cout << income ;
fin1.get (income) ;
}
double next, sum = 0;
int count = 0;
while (fin >> next )
{
sum = sum + next;
count ++;
}
fout << sum;
------------------------------------
example file (income.dat)
monday 1000
tuesday 1500
wednesday 1200
the program seems cant sum up the number......any hint or suggestion can help me change to program to solve the problem?