C code: how get IP adress

Hi all,

can you help me to find a C code that retrieve IP address? I'm not expert programmer about socket and network.
I need simple code that can get the etho address not 127.0.0.1

Thank in advance
If you want to do network programming, you really need to read this book: http://books.google.com/books?id=ptSC4LpwGA0C&printsec=frontcover

Why Unix networking programming?
Because that book is still the definitive reference.
Beej's guide is also very, very useful.
http://beej.us/guide/bgnet (I typed that from memory, so apologies if it's broken).
Last edited on
Topic archived. No new replies allowed.