I am trying to format my function so that the output has a space between the headers and using put_money a dollar sign in front of the values but when I try this it does not work.Any help? Here is my code:
void PrintFileContents(std::ifstream &str)
{
// Put your code here
std::string name;
double savings;
double credit;
SetInputStreamPos(str, 0);
std::locale();
std::cout << "Name" << std::setw(12) << "Savings" << std::setw(12) << "Credit " << std::endl;
while (str >> name >> savings >> credit )
std::cout << name << std::setw(12) << put_money(savings) << std::setw(12) << put_money(credit) << "\n";