how to get external ip address?

view story

http://www.linuxforums.org – Does anybody know how to get external ip address with c and socket? To make things clear, A linux machine may have multiple ip address, for example, (local ip address) (external address) if there a c function like getaddrinfo(..) which can get the external address(, rather than the local address( Thanks a lot. (HowTos)