I am trying to overload part of my class to a string
and I can't get the overloading to work. Alternatively, I will also have a long long
overload, but I just assume that it will be the same excepted for long long
instead of string
.
class FileData
{
public:
string extensions_;
unsigned long long containsBytes_;
};
string& operator = (string& s , FileData& fd)
{
s= fd.extensions_;
return s;
}
string extName = fileVector[0];
The error I keep getting is ERROR:'operator=' must be a member function. I also tried using istream but that also didn't work.
Anybody know how I could go about this?