Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // usage: cc -o char_array_longlong char_array_longlong.c
- // output: 0x706050403020100
- // 0xf0e0d0c0b0a0908
- #include <stdio.h>
- #include <stdint.h>
- int main() {
- uint8_t array[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ,14, 15};
- for(int i=0; i<sizeof(array); i+=8) {
- uint8_t *p = array + i;
- uint64_t l = *((uint64_t *)p);
- printf("0x%llx\n", l);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement