Part Number: MSP430F1611
Tool/software: TI C/C++ Compiler
Hello,
I have a question due to some weird issues compiling code.
int test(char * header) {
if (header[0] == ~header[1]) {
return 0;
}
return 1;
}
This code does not work. It does not return 0, if the second byte is the bitwise invertation of the first byte. But the following code DOES work:
int test(char * header) {
char test[2];
test[0] = header[0];
test[1] = ~header[1];
if (test[0] == test[1]) {
return 0;
}
return 1;
}
Can someone explain me why this is happening?