I need help overloading operator for the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
class Dot
{
public:
void PutName (const char*);
void PutBarCode (uint32_t);
void PutCost (float);
const char* ObtainName ()const;
uint32_t ObtainBarCode () const;
float ObtainCost () const;
private:
char* name_;
uinit32_t code_;
float cost;
};
std::istream& operator>> (std::istream& is, Dot& d)
{
?
}
|
Last edited on
Is there a way of doing this without putting it inside my class and without using friend?
Every time I included outside the class without friend, I get a "no match for operator" error.