The
&
is the 'address-of' operator, as in "what is the address of
n1?" (Not to be confused with the 'reference-type' type modifier.)
The
*
is the 'dereference' operator, as in "I wanna mess with the thing addressed by
Node1".
Your assignment operator is correct, but you are not asking to use it. Pay attention to the
type of thing:
Node1
is a pointer (to a 'Sense' object) [
I
think...]
*Node1
is a 'Sense' object
n1
is a 'Word' (some kind of integer?)
&n1
is a pointer (to a 'Word')
n2
is a 'Sense' object
&n2
is a pointer (to a 'Sense' object)
Your assignment operator only works with 'Sense' objects. Not pointers or anything else. Hence, you should have:
1 2 3 4 5
|
void SetNodesInEdge(Word n1, Sense n2)
{
*Node1=n1; // Assuming you have an assignment operator as below:
*Node2=n2;
}
|
The assignment operator you need for Word to Sense:
1 2 3 4 5
|
Sense& operator = (const Word& word)
{
/* Do whatever you need to make a 'Sense' have value from a 'Word'
return *this;
} */
|
Hope this helps.