how to retrieve the IP address of a system?
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
pls do help M.V.Nair
-
pls do help M.V.Nair
-
try
Malini Nair wrote:
gethostbyname()
gethostbyname()for better you just search google by this string gethostbyname() in vc++
vimal
Hi, gethostbyname ... has been deprecated ;-) use: int getaddrinfo( const char* nodename, const char* servname, const struct addrinfo* hints, struct addrinfo** res ); addrinfo host; LPADDRINFO res; ... host.ai_flags = AI_CANONNAME; host.ai_protocol = IPPROTO_TCP; host.ai_family = PF_INET; host.ai_socktype = SOCK_STREAM; getaddrinfo( strMachineName, NULL, &host, &res ); ...
----------- Mila