Click here to Skip to main content
15,916,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Can anyone help me find a C-program to find the IP address of the current machine. I have very little experience in network programming.

Thanks
Posted
Comments
Sandeep Mewara 30-Nov-10 2:53am    
Tried anything? Google? Code Project articles?

1 solution

first call WSAStartup (of Winsock 2)
an then
gethostbyname

but you have to get the hostname first with gethostname
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900