Help, I'm getting the following error message:
error C2040: 'money' : 'double' differs in levels of indirection from 'char [15]'
error C2088: '>>' : illegal for class
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <sstream>
#include <string.h>
using namespace std;
string FileName;
void starline();
float balance;
float deposit;
float check;
double m;
void starline() //function declarator
{
for(int j=0; j<65; j++) //function body
cout << '-';
cout << endl;
}
int main()
{
cout << "Enter a file name (including extension): " << endl;
char FileName[300];
cin.getline (FileName,300);
ifstream input(FileName);
if (!input.good())
{
cerr << "Unable to open file" << endl;
exit(1);
}
while (!input.eof())
{
starline();
char deposit[15];
input.getline(deposit, 15, ':');
cout << left << setw(15) << deposit;
char date[15];
input.getline(date, 15, ':');
cout << setw(15) << date;
char place[15];
input.getline(place, 15, ':');
cout << setw(15) << place;
char money[15];
input.getline(money,15);
cout << right << setw(15) << "$ " << money << right << endl;
starline();
ifstream fin;
double money = 0.0;
fin.open(FileName);
double m = atof ( money);
//test for success, of course
fin >> money; //input stored in the double
}
return 0;
}