delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/05/11/11:56:06

From: rminnich AT sarnoff DOT com (Ron G. Minnich)
Subject: Re: Finding Out My Own IP-Address
11 May 1998 11:56:06 -0700 :
Message-ID: <Pine.SUN.3.91.980511085238.22871C-100000.cygnus.gnu-win32@terra>
References: <355152A4 DOT 7292585D AT wgn DOT net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

On Wed, 6 May 1998, $Bill Luebkert wrote:
> > When I dial in to my provider via NT-RAS, I'm assigned a dynamic IP address -
> > which is what I'm trying to find out.
> $name = (gethostbyname ("localhost"))[0];
> $addr = (gethostbyname ($name))[4];
OK, I believe this works. But why doesn't 
gethostname
followed by a gethostbyname? no gethostname entry? 

Also why the [4]? 

ron
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019