2 ms·
for anyone who wants to run that themselves: #include <stdio.h> #include <stdint.h> int main(){ uint8_t start = -1; printf("%x\n", start); // p
by baby 9y ago
for anyone who wants to run that themselves:
#include <stdio.h>
#include <stdint.h>
int main(){
uint8_t start = -1;
printf("%x\n", start); // prints 0xff
uint64_t result = start << 24;
printf("%llx\n", result); // should print 00000000ff000000, but will print ffffffffff000000
result = (uint64_t)start << 24;
printf("%llx\n", result); // prints 00000000ff000000
return 0;
}