filestream errors

My homework is to write a program that takes information from a .txt document and outputs to another .txt document. This is what I wrote:

#include <cmath>
#include <fstream>
#include <string>

using namespace std;

int main ()
{
ifstream inFile;
inFile.open("investments.txt");

ofstream outFile;
outFile.open("interest.txt");

string firstname, lastname;
double investment;

while(inFile.good())
{
double p;
p=investment;

inFile >> firstname >> lastname >> investment;
outFile << firstname << " " << lastname << " " << p*(1.04) << " " << p*(1.04)^5 << " " << p*(1.04)^10 << " " << p*(1.04)^20 << endl;
}

return 1.0;
}

The only place it's giving me errors is the outFile line. It says "Invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'" and "Invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'"

Does anyone know what these mean and how to resolve them?
^ is the bitwise xor operator. If you want exponentiation you should use the std::pow function in <cmath>.
Topic archived. No new replies allowed.