12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
#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; }
money