I write a server using the function char* inet_ntoa(struct in_addr in),When I turned on the header
<sys/socket.h>and <netinet/in.h>, binary executable can be generated using compiler warnings, but a segment error occurs when the program processes the returned string from inet_ntoa. But when I added the title <arpa/inet.h>,, everything looks fine.
What's the matter?
source
share