What's wrong with this code which returns xor of two nodes address?
//struct is common userdefined datatype in c/c++ and class is it's alternative
struct node* XOR (struct node *a, struct node *b)
{
//this logic is used to fill the nodes with address of a xor linked list
return ((int) (a) ^ (int) (b));
}
//struct is common userdefined datatype in c/c++ and class is it's alternative
struct node* XOR (struct node *a, struct node *b)
{
//this logic is used to fill the nodes with address of a xor linked list
return ((int) (a) ^ (int) (b));
}A. nothing wrong. everything is fine
B. type casting at return is missing
C. parameters are wrong
D. total logic is wrong
Answer: Option B

Join The Discussion