How can I resolve a host IP address, given a URL in Visual C++?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To use the socket functions under Windows, you have to start by calling
WSAStartup, specifying the version of Winsock you want (for your purposes, 1.1 will work fine). Then you can callgethostbynameto get the address of the host. When you’re done, you’re supposed to call WSACleanup. Putting that all together, you get something like this: