probably inet_aton requires a pointer to a variable of type struct in_addr to fill.. the pointer that you pass to it is not valid. Try: struct in_addr addr; inet_aton("192.168.0.1", &addr); ...
Use gdb. Then go through the execution step by step
inet_aton("...", &addr) inet_ntoa(addr)
Обсуждают сегодня