From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17447 invoked by alias); 28 Feb 2002 09:16:35 -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 17326 invoked from network); 28 Feb 2002 09:16:22 -0000 Received: from unknown (HELO doul.iservindia.com) (203.168.74.30) by sources.redhat.com with SMTP; 28 Feb 2002 09:16:22 -0000 Received: from naini.zyberway.com [203.168.74.249] by doul.iservindia.com with ESMTP (SMTPD32-7.05) id A6A551700F2; Thu, 28 Feb 2002 14:51:41 +0530 Message-ID: <899658674.1014887162812.JavaMail.root@naini.zyberway.com> From: snodx@hotmail.com To: gcc-help@gcc.gnu.org Subject: Re: IP ADDRESS OF MACHINE Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 28 Feb 2002 01:38:00 -0000 X-SW-Source: 2002-02/txt/msg00293.txt.bz2 Thanks Andrea 'Fyre Wyzard' Bocci for your response. I ran the code that you gave. It DID give me the IP Address of the machine which was: 127.0.0.1 This means that my system has been set to localhost address. This localhost address will be used by those application servers which will be installed and configured on my system such as the Apache server. But 127.0.0.1 is set BY DEFAULT. Using the /bin/netconf application I set my standalone computer's proper TCP/IP address which was 192.168.0.2. Using a C/C++ program I wanted to obtain THIS address (192.168.0.2) not 127.0.0.1 I understand that the confusion has arisen because I posted the wrong question. I am rephrasing the question here: I have a standalone computer and I dont know whether there is a NetWork Card installed and configured on this computer. Using /bin/netconf I set the local TCP/IP address of this computer which is 192.168.0.2 Now using a C/C++ program I wish to obtain the TCP/IP address of the machine. How do I go about this. SNODX