Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
char *address = inet_ntoa(addr_c.sin_addr); std::cout << address << std::endl; USHORT port = ntohs(addr_c.sin_port); char *act = address + (unsigned char)port; std::cout << act << std::endl;
char *act = address + (unsigned char)port;
std::string
const std::string address = inet_ntoa(addr_c.sin_addr); std::cout << address << std::endl; USHORT port = ntohs(addr_c.sin_port); const std::string act = address + std::to_string((unsigned char)port); std::cout << act << std::endl;
char *address = inet_ntoa(addr_c.sin_addr); USHORT port = ntohs(addr_c.sin_port); std::ostringstream addr_port; addr_port << address << ":(" << port << ")"; std::cout << addr_port.str() << std::endl;