From: Nelson Guedes Paulo Junior <npaulo@linux.ime.usp.br>
To: Andrea 'Fyre Wyzard' Bocci <fwyzard@inwind.it>
Cc: snodx@hotmail.com, gcc-help@gcc.gnu.org
Subject: Re: IP ADDRESS OF MACHINE
Date: Thu, 28 Feb 2002 06:03:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.21.0202281037300.5877-100000@jacuzzi.linux.ime.usp.br> (raw)
In-Reply-To: <5.1.0.14.0.20020228013959.00ba8968@popmail.inwind.it>
Hi,
I,ve tryed the following program on my machine (Debian) and
got the following address line:
address: 4294967232.4294967208.4294967280.4294967243
GCC Version:
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
What's wrong?
Should I use some special options on GCC?
I've compiled with -Wall and no warnings have apeared.
Thanks.
-----
Nelson Guedes Paulo Junior
E-mail: <npaulo@linux.ime.usp.br> UIN: 2489382 (Tender [:alpha:]*)
"LAPTOPirose é a doença causada pela urina do mouse"
On Thu, 28 Feb 2002, Andrea 'Fyre Wyzard' Bocci wrote:
> I have this one working on my Linux machine:
>
> /* ip.c */
> #include <unistd.h>
> #include <netdb.h>
>
> #define SIZE 256
>
> char hostname[SIZE];
> char **alias;
> char **entry;
> struct hostent *host;
>
> int main (int argc, char **argv) {
> gethostname (hostname, SIZE);
> host = gethostbyname (hostname);
>
> printf ("host name: %s\n", host->h_name);
> for (alias = host->h_aliases; *alias; alias++)
> printf ("alias: %s\n", *alias);
> for (entry = host->h_addr_list; *entry; entry++)
> printf ("address: %hhu.%hhu.%hhu.%hhu\n", \
> (*entry)[0], (*entry)[1] , (*entry)[2] , (*entry)[3]);
>
> return 0;
> }
> /* end of ip.c */
>
> The output is
>
> host name: stufis06.fisica.unifi.it
> alias: stufis06
> address: 150.217.141.25
>
> HTH, fwyzard
>
>
next prev parent reply other threads:[~2002-02-28 13:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-27 9:17 snodx
2002-02-27 19:32 ` Andrea 'Fyre Wyzard' Bocci
2002-02-28 6:03 ` Nelson Guedes Paulo Junior [this message]
2002-02-28 6:49 ` John Love-Jensen
2002-02-28 10:15 ` Nelson Guedes Paulo Junior
2002-03-01 6:34 ` John Love-Jensen
2002-03-05 1:07 ` Bharathi S
[not found] <616BE6A276E3714788D2AC35C40CD18D53345D@whale.softwire.co.uk>
2002-03-05 1:18 ` Rupert Wood
[not found] <616BE6A276E3714788D2AC35C40CD18D47C245@whale.softwire.co.uk>
2002-02-28 5:39 ` Rupert Wood
-- strict thread matches above, loose matches on Subject: below --
2002-02-28 4:04 snodx
2002-02-28 4:30 ` Michal Lipták
2002-02-28 3:56 snodx
2002-02-28 3:25 snodx
2002-02-28 3:55 ` Edmund Green
[not found] <616BE6A276E3714788D2AC35C40CD18D47C203@whale.softwire.co.uk>
2002-02-28 2:43 ` Rupert Wood
2002-02-28 1:38 snodx
2002-02-27 5:13 snodx
2002-02-26 18:29 Robert Lopez
2002-02-26 4:18 snodx
2002-02-26 5:46 ` Stephano Mariani
2002-02-28 14:02 ` Florian Weimer
2002-02-26 0:35 snodx
2002-02-26 1:29 ` Frank Schafer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.21.0202281037300.5877-100000@jacuzzi.linux.ime.usp.br \
--to=npaulo@linux.ime.usp.br \
--cc=fwyzard@inwind.it \
--cc=gcc-help@gcc.gnu.org \
--cc=snodx@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).