ifstream InClientFile;
int Account;
string Name;
float Balance;
// Open and
test input file.
InClientFile.open(
"clients.txt", ios::in );
if( !InClientFile
)
{
cerr << "Client
file could not be opened." << endl;
}
else
{
// setup column
headers
cout << "Account" << "\t" << "Name" << "\t" << "Balance" << endl;
while(
InClientFile >> Account >> Name >> Balance )
{
cout << Account
<< "\t" << Name << "\t" << Balance << endl;
}
// we're done
close file.
cout << endl;
InClientFile.close();
}
return 0;