I want to compare the actual object stored in the vector. I was wondering if this is comparing the address or the value of the object in the vector. The > operator has been overloaded for this object. I was under the assumption i was suppose to use * instead of & in this situation. Any clarification will be much appreciated.
selectedHandB and selectedHandA are pointers
1 2 3 4
if((&selectedHandB)[0] > (&selectedHandA)[0])
{
std::cout << " B > A " << std::endl;
}
> I was under the assumption i was suppose to use * instead of & in this situation.
don't guess, think.
> I want to compare the actual object stored in the vector.
> selectedHandB and selectedHandA are pointers
¿how are they related to the vector?
¿where is the vector?
Vector was already created then i called a function to determine which cards the player wants to use. If the player selects one card its gonna be the very first in the vector which is what im comparing.
and throw all the pointers out of the code. Unless you need them for something else.
Edit: and you have this same question up at least 3 times. Please don't do that. It is not necessary to clutter up the boards; everyone sees the same posts in all the forums and will help you when they can.