>From: "Mundt, Sebastian" <seb...@ge...>
>Reply-To: dev...@li...
>Subject: [Dev-C++] IP address
>Date: Tue, 19 Dec 2000 16:32:01 +0100
>
>Hi
>
>Is there a function telling me my own IP address?
>I don't want to use the DOS command ipconfig.
>
>Thank you very much!!
>
If you are using windows, then you should be able to. First you have to make
a call to WSAStartup to initialize the winsock dll. Then you can call
gethostname to return the hostname of the local machine. You can then pass
this into the gethostbyname function to get a hostent which will list the ip
address of the machine, as well as some other information.
Chad Simmons
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
|