我有一个in_addr_t类型的变量,我想在给定的ip中使用connect()。因此,我需要一个(struct sockaddr *)变量作为connect()的参数。如何插入使用in_addr_t变量代替?in_addr_t var; // Given variable, not actually declared here ofc
int sockfd = socket(AF_INET, SOCK_STREAM
不确定我错过了什么。我正在尝试确定IP地址172.27.12.32是否在IP地址20.0.0.0和255.255.252.0的范围内std::string one("200.0.0.0");std::string three("255.255.255.255");
long two_addr = inet_addr(two.c_str());
long three_addr