How can I get the TCP/IP Address using C/C++

gethostbyname(), requires tcp development libs.