How to get the external IP address in C++?
<p>How would I go about finding the external IP of a user in C++? I need a method that would work for any system, not just mine. Additionally, the system could be behind a router, thus NAT would come into play making it harder to retrieve the external IP.</p>

<p>Ideally, I'd like to do this without using any 3rd party service like whatsmyip. However, I'm not sure if this is possible. If I don't use a 3rd party service, I'd have to go through the router and if ping is disabled I'm guessing this might not be possible (I could be wrong, not too sure).</p>

<p>If I were to use a 3rd party service like whatsmyip, how might I go about this? Is there a web service that they expose? I've seen this link: <a href="http://automation.whatismyip.com/n09230945.asp" rel="nofollow">http://automation.whatismyip.com/n09230945.asp</a> but it doesn't seem to be working.
Would it be possible to fetch the external IP by using some HTTP methods and retrieve it, or would I effectively need to scrape the page to get the IP from it?</p>

<p>I'm limited to using Windows API's to accomplish this (no 3rd party API's)</p>