Ying Yang said:
How would I go about it using casts?
link1 = (*link1)link2; //right?
Wrong. That doesn't even compile.
Your compiler is complaining because it really doesn't want to assign
link2 to link1. It thinks that's a dangerous or incorrect thing to do.
You could "shut the compiler up" with a correct cast. But the compiler
is your friend, you should only overrule it if you know exactly what
you are doing and why. Since you are not even sure of the syntax for
casting, it seems unlikely that you can carefully judge that casting
really is appropriate in this case.
That is why people have asked you for more information about the
relationship between the Node1 and Node2 types, and an explanation of
what you are trying to do. They want to help you avoid further
problems a short way down the line. Nobody wants to show you how to do
the cast and leave it at that when it seems very likely that casting
will just cause more problems.
So, how are the Node1 and Node2 types related (if they are related at
all), and why are you trying to assign a Node2 to a Node1?
GJD