Advertisement

07.26.2003 at 06:23AM PDT, ID: 20691149
[x]
Attachment Details

Getting IP address in C (Linux)

Asked by darko_poljak in C Programming Language

Tags: c, ip, address, linux, getting

Hello!
I want to write programm in C that will print on the screen IP address I got when I connected to the internet.
And I need help.
When I tryed with gethostname and gethostbyname it prints out 127.0.0.1
Thanks!Start Free Trial
 
Loading Advertisement...
 
[+][-]07.26.2003 at 06:28AM PDT, ID: 9010713

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2003 at 06:28AM PDT, ID: 9010714

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2003 at 07:07AM PDT, ID: 9010820

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2003 at 09:24AM PDT, ID: 9011198

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.26.2003 at 09:50AM PDT, ID: 9011305

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.26.2003 at 10:04AM PDT, ID: 9011349

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.26.2003 at 03:34PM PDT, ID: 9012423

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Tags: c, ip, address, linux, getting
Sign Up Now!
Solution Provided By: jscase
Participating Experts: 4
Solution Grade: B
 
 
[+][-]07.27.2003 at 10:45PM PDT, ID: 9017412

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.28.2003 at 02:33PM PDT, ID: 9023520

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.19.2004 at 08:13PM PST, ID: 10638890

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03.23.2004 at 10:12AM PST, ID: 10659957

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32