How to get my own IP address without DNS

From: Kazu (nospam-kazuhhh_at_infoseek.jp)
Date: 05/31/05


Date: Tue, 31 May 2005 19:25:06 +0900

Hi.

I am trying to get my own IP address. I know that there is a way to use
gethostname and gethostbyname, but this has a problem.
 1. I cannot use this if no DNS is specified.
 2. If several IP addresses are given for my domain name and
    the ordering is round robin, I cannot tell which one is my real IP address.

Is there any way to get my own IP address in C or C++ without using DNS?
(such as ifconfig)

Kazuh