I made a reproducible code as below/
#include <stdio.h>
int main(void)
{
long int a = 0x0;
a |= (1 << 31);
printf("a: 0x%lx\n", a);
}
I expect 'a' should be 0x0000000080000000.
but the value is given as
a: 0xffffffff80000000.
Why are upper 32 bits filled with 1 programmatically, and if I want to make 'a' as single one and all zero value, what can I do?
Change
to
1is anintconstant, which issigned intby deafult.