How could I display in a messagebox the output of the function gethostbyname("http://www.whatever.com") ?
How could I display in a messagebox the output of the function gethostbyname("http://www.whatever.com") ?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
First, get the hostname with the function. Make sure that a variable is set like this(Be sure to include stdio.h for sprintf()):
name=gethostbyname(blah, blah);
Then, create a char:
char newName[200];
sprintf(newName, "%d", name);
MessageBox(hwnd, newName, "Title", MB_OK | MB_ICONINFORMATION);
I hope it helps!
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK