What’s wrong with this code which returns xor of two nodes address ?
Posted: Wed Jul 13, 2022 7:42 pm
advertisement
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
}
});
//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
var adpushup = window.adpushup || {};
adpushup.que = adpushup.que || [];
adpushup.que.push(function () {
if (adpushup.config.platform === "MOBILE") {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
} else if ((window.outerWidth <= 768) || (window.outerWidth == 0)) {
adpushup.triggerAd("21eae76a-c83f-42b0-aec5-01d590a53f37");
}
});
//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