String as argument

Hi everyone,

I have a function which send a string as argument to a txt file, like the following:

1
2
3
4
5
void Fprint(... ofstream& myfile, const string a, const int b)
    ......
    myfile << "name: " << a << " age:" << b << "\\" << endl;
    ......
    }

However, my IDE (msvc12.0) popup an error about the << before a, by citing "No operator matches these operands"...

Could anyone please tell me for what reason this is?

Thanks in advance!
Did you #include <string> ?
Got it! Just forgot this thing...
Thanks! :)
Topic archived. No new replies allowed.