From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21887 invoked by alias); 28 Feb 2002 20:25:12 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 21831 invoked from network); 28 Feb 2002 20:25:11 -0000 Received: from unknown (HELO mail.enyo.de) (212.9.189.162) by sources.redhat.com with SMTP; 28 Feb 2002 20:25:11 -0000 Received: from [212.9.189.171] (helo=deneb.enyo.de) by mail.enyo.de with esmtp (Exim 3.34 #2) id 16gX67-00041P-00; Thu, 28 Feb 2002 21:24:15 +0100 Received: from fw by deneb.enyo.de with local (Exim 3.34 #4) id 16gX6x-0000QI-00; Thu, 28 Feb 2002 21:25:07 +0100 To: snodx@hotmail.com Cc: gcc-help@gcc.gnu.org Subject: Re: IP ADDRESS OF MACHINE References: <-125095592.1014721227337.JavaMail.root@naini.zyberway.com> From: Florian Weimer Date: Thu, 28 Feb 2002 14:02:00 -0000 In-Reply-To: <-125095592.1014721227337.JavaMail.root@naini.zyberway.com> (snodx@hotmail.com's message of "Tue, 26 Feb 2002 16:46:10 +0530") Message-ID: <87zo1t1hi4.fsf@deneb.enyo.de> User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00314.txt.bz2 snodx@hotmail.com writes: > So I wish to obtain my standalone computer's IP Address through a > C/C++ program. What function should I use for this? The assumption that a machine has got a single IP address is wrong, generally speaking. Quite a few hosts with IP stacks do not even know the IP address with which they are visible on the Internet. You should examine your application and determine what "IP address" really means in this context.