I have the following:
void calculate(unsigned long num1, unsigned long num2){
int32_t invertednum2 = ~(num2); // yields 4294967040
printf("%d\n", invertednum2); // yields 255
// num1 is 3232236032
int32_t combine = (int32_t) num1 & num2;
printf("%d\n", combine); // yields 0???
}
I'm trying to AND num1 and num2 so that the result would be:
000000000000000011111111
I'm not sure if I'm ANDing correctly with two different bit lengths or if I should cast.
Any help would be appreciated!
Thanks