| | |
finding ip address with c++ (cross platform)
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 8
Reputation:
Solved Threads: 0
ok before someone points me to google or to the search box, let me state that I have already done the searching.
The solutions I get either state using winsock(which happens to be windows only)
or parsing the output of ifconfig(which happens to be linux and maybe unix only)
and further has the problem that if the pc is in a network and traffic is routed through a gateway, ifconfig will give localnetwork address, instead of gateway address.
so my question is there any cross platform way of getting ipaddress of local machine "as seen from the web"?
The ip returned should match that given by whatismyip.com and such sites. Or do I just have to bite the bullet here?
The solutions I get either state using winsock(which happens to be windows only)
or parsing the output of ifconfig(which happens to be linux and maybe unix only)
and further has the problem that if the pc is in a network and traffic is routed through a gateway, ifconfig will give localnetwork address, instead of gateway address.so my question is there any cross platform way of getting ipaddress of local machine "as seen from the web"?
The ip returned should match that given by whatismyip.com and such sites. Or do I just have to bite the bullet here?
Last edited by kaleshwar; Jun 21st, 2008 at 5:23 am.
![]() |
Similar Threads
- Cannot find server or DNS Error - please help! (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: Simple question
- Next Thread: Help with homework - Days Since Last Birthday
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library linker list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






