In main:
void HandleAction(const RandomWriter & rw, string choice)
{
if(choice == "P")
{
string fileInput;
cout << "Change input file: " << endl;
cin >> fileInput;
rw.SetFilename(fileInput);
}
}
In a RandomWriter class:
void RandomWriter::SetFilename(string filename)
{
string text = GetFullFile(filename);
if (text != "")
{
fullText = text;
this->filename = filename;
}
/
Why am i getting this error when i try to pass fileInput as a parameter to SetFileName?
Thanks in advance guys!
||=== error: passing 'const RandomWriter' as 'this' argument of 'void RandomWriter::SetFilename(std::string)' discards qualifiers [-fpermissive]|
std::stringobject is empty or not, there's theemptymember function.