uni*_*n83 -2 c sockets constants ipv6 endianness
u_int32_t ip6_address[1][4] = { {0x00000001, 0x0, 0x0, 0x12345678} };
Run Code Online (Sandbox Code Playgroud)
有时最简单的看一下:
$ cat example.c
#include <stdint.h>
uint32_t ip6_address[1][4] = { {0x00000001, 0x0, 0x0, 0x12345678} };
$ make example.o
clang -Wall -Wextra -pedantic -c -o example.o example.c
$ otool -d example.o
example.o:
(__DATA,__data) section
0000000000000000 01 00 00 00 00 00 00 00 00 00 00 00 78 56 34 12
Run Code Online (Sandbox Code Playgroud)
你可以为你的第二个例子做一些类似的事情.