how to cast a char *mystring to a structure pointer ??
hey guys, how do you Cast a char *mystring to a structure pointer, namely "hostent" ??
looking at
http://msdn.microsoft.com/library/de.../hostent_2.asp ,
it says
Quote:
"On successful completion, the buffer specified to the original function call contains a hostent structure. To access the elements of this structure, the original buffer address should be cast to a hostent structure pointer and accessed as appropriate."
like this??
Code:
char *hostEntry2 ;
hostent *abc= (HOSTENT)*hostEntry2;
nope it doesnt work
i ultimately want to use WSAAsyncGetHostByName to get the IP address of a computer. ( i use WSA version because the GetHostByName version blocks)
any help?