文章链接:https://codemouse.online/archives/2020-03-08185618
报错原因
在使用inet_aton函数的时候,有时候会报错,是因为64位机子的时候,比32位机子多一个头文件,将头文件加上就可以了
#include <arpa/inet.h>
-
x64:
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h> -
x32:
#include <sys/socket.h>
#include <netinet/in.h>