I have problem with XOR. There is some example. I have this: bool a[4]=[1,0,0,1] and bool b[4]=[0,1,0,1]. I want to create XOR and write into boll xor[4]. I try this,but it does not work. Can you help me with this?
bool xor[4];
for(int i=0;i<4;i++){
if((a[i]==0) && (b[i]==0)){
xor[i]=0;
}
else if((a[i]==1) && (b[i]==1)){
xor[i]=0;
}
else if((a[i]==1) && (b[i]==0)){
xor[i]=1;
}
else if((a[i]==0) && (b[i]==1)){
xor[i]=1;
}
}