|
|
发表于 2005-8-19 22:42:33
|
显示全部楼层
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <arpa/inet.h>
- int main(int argc, char *argv[])
- {
- struct in6_addr addr = {
- .s6_addr32 = {0,0,0,1},
- };
- char buf[INET6_ADDRSTRLEN];
- if (inet_ntop(AF_INET6, &addr, buf, sizeof(buf)))
- printf("%s\n", buf);
- }
复制代码
LZ给钱  |
|