关于inet_ntoa的问题
#include <winsock2.h>
#include <stdio.h>
#pragma comment( lib, "ws2_32.lib" )
struct sockaddr_in server_addr;
struct sockaddr_in client_addr;
int main(void)
{
long a =0x102030FF;
long b =0x405060FF;
memcpy((char*)&server_addr.sin_addr, (char*)&a, sizeof(server_addr.sin_addr));
memcpy((char*)&client_addr.sin_addr, (char*)&b, sizeof(client_addr.sin_addr));
printf("server:%s\n", inet_ntoa(server_addr.sin_addr));
printf("client:%s\n", inet_ntoa(client_addr.sin_addr));
printf("server:%s\nclient:%s\n",
inet_ntoa(server_addr.sin_addr), inet_ntoa(client_addr.sin_addr));
printf("server:%s\nclient:%s\n",
inet_ntoa(client_addr.sin_addr), inet_ntoa(server_addr.sin_addr));
return0;
}