I am writing c++ code for a telnet client. I am having problems getting the host address from the user input.
struct in_addr peers;
cin>>peers;
peerserver = gethostbyaddr((const char*)peers,4,AF_INET);
if (peerserver == NULL)
exit(0);
I am new to c++, can anyone suggest a better way of getting the host addr with user input. Thanks in advance.