My function is:
void Matrix::WriteToFile(std::string fname) const
{
ofstream myfile;
myfile.open ("std::string fname.txt");
for (int i = 0; i<data_.size(); i++)
myfile << data_[i] << " ";
myfile.close();
}
and then in the main I have A.WriteToFile("hello"), but it's saving it as fname still? Can anyone please tell me what I'm doing wrong?
Thanks in advance!