I was trying to declare 64bit variable in C with unsigned long long datatype but it not working and behaving similar to uint32 bit variable. What is the solution to access / check the bit above 32 ?
#include <stdio.h>
#include <stdint.h>
int main() {
// Write C code here
printf("Hello world");
unsigned long long temp = 0x1234567890123456ULL;
unsigned long long temp2 = temp >> 1;
uint64_t var = 0x1234567890123456;
printf("\n%x", (long long) temp);
printf("\n%x", (long long) temp2);
printf("\n%x", 1ULL << 31ULL);
printf("\n%x", 1ULL << 32ULL);
printf("\n%x", var);
return 0;
}
Output:
Hello world
90123456
48091a2b
80000000
0
90123456