https://github.com/aimwang https://gitlab.com/aimwang
1 2 3 4 5 6 7 8
#include <stdint.h> static uint8_t is_little_endian(void) { uint16_t value = 0x0001; uint8_t *byte_ptr = (uint8_t *)&value; return (*byte_ptr == 0x01); // If the system is little endian, the least significant byte is 0x01. }
張貼留言
沒有留言:
張貼留言