Skip to content

Instantly share code, notes, and snippets.

@FleXoft
Last active April 3, 2026 15:43
Show Gist options
  • Select an option

  • Save FleXoft/84598e57b0f553a61df489f25a8056f6 to your computer and use it in GitHub Desktop.

Select an option

Save FleXoft/84598e57b0f553a61df489f25a8056f6 to your computer and use it in GitHub Desktop.
big-endian_testing.c
#include <stdint.h>
#include <stdio.h>
int main(void)
{
uint32_t x = 0x12345678;
int i;
for (i = 0; i < sizeof(x); i++) {
printf("mem[%d] = 0x%02x\n", i, ((char*)&x)[i]);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment