16 Answers
New Answer2/14/2019 5:42:46 AM
Kailash Loncha16 Answers
New AnswerHi Terminator you're back! (I'm so thrilled!) Well, to answer your question, each struct created is an arrow that references to a particular object. Therefore, you're seeing if the first arrow references the exact same struct that the 2nd struct is referencing.
I wouldn't mind if you asked :) Btw the times have changed so I doubt we should be speaking here.
Terminator No you can't compare structures using "==" operator. You will get the error "invalid operands to binary operator" You need to compare them field by field. "==" operator is a boolean operator so it needs lhs and rhs either as bool or a datatype convertible to bool. structure is a compound datatype hence not convertible to bool(or BOOL)
Cannot compare structures like that but you can compare pointers to structures to see if they refer to the same structure.
Well yes we can because the "==" operator either makes the first variable/structure equals to the next variable/structure what I mean is if u put it in an if statement it checks if the two structures/variables are the same then it runs the if statement
Yeah. It is relational operator. Relational operators are only used to compare two or more things. I think you got the answer.
Actually yes, but the == operator will only check if the two references of structs point to the same struct.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message