The assignment operator= is highlighted by intellisense with the error message:
Error: a value of type "hostent *" cannot be assigned to an entity of type "hostent *"
This makes no sense as gethostbyname() returns a hostent*.
The other problem is that getaddrinfo() is undefined even with the <WinSock2.h> included.
I have the ws2_32.lib in the linker - so what can be going wrong??
Thanks your reply was helpful and the getaddrinfo() issue is resolved.
Still not sure about the squiggles under the =assignment operators telling me I can't assign a hostent* to hostent*. Each time I hit F1 I get different operator= overloading code from msdn.
Perhaps struct hostent is corrupted on my system?
Finally got rid of the squiggles by doing this:
pHent = (hostent*)gethostbyname(servername);
a conversion cast - really? On the same type...c'mon Bill (VC++2010, the original code compiles just fine on GCC and VC2008)