This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: Finding Out My Own IP-Address
- To: "gnu-win32 at cygnus dot com" <gnu-win32 at cygnus dot com>, "'Oliver Copp'" <lyger at fh-landshut dot de>
- Subject: RE: Finding Out My Own IP-Address
- From: Sergey Okhapkin <sos at prospect dot com dot ru>
- Date: Thu, 7 May 1998 14:13:43 +0400
Oliver Copp wrote:
> Hi !
>
> Is there a function which allows me to find out my current IP address ?
>
> My best guess was to use gethostbyname("localhost") but that always returns
> 127.0.0.1.
>
Try gethostbyname(gethostname()).
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".