What does this prototype mean?
I want to overload the operator = (assignment). The header/prototype the overloading function is supposed to look like this (according to wikipedia)
|
Type1& operator= (const Type2& b);
|
What does 1&, and 2& mean?
Is that meant to be used like this?
1 2 3 4 5 6 7 8 9 10 11 12
|
class Object
{
//... stuff ...
Object1& operator= ( Object2&v);
//... stuff ...
}
//Code
Object1& Object::operator = (Object 2&v)
{
//...code...
}
|
EDIT : The code above seems not to work. What should i do?
Last edited on
What does 1&, and 2& mean? |
It doesn't mean anything. It's not 'Object 2&', it's 'Object2 &'. A reference to an Object2.
Topic archived. No new replies allowed.