Answer the question
In order to leave comments, you need to log in
How to get whole string from USHORT and char*?
The bottom line is that you need to get the full IP:PORT address. If I can take the IP, then connect to the port - no.
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;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question