[network] ip und hostname ermitteln
-
wie finde ich unter windows und linux in C++ die jeweilige IP heraus?
std::string getLocalIP() { std::string ip //code return ip; }
-
Hallo,
mit Standard-C++ gar nicht. Du brauchst also die Hilfe deines BS oder eine hübsche Netzwerk-Bibliothek.
Mit der Socket-API geht es z.B. so:
http://www.codeguru.com/forum/showthread.php?s=&threadid=233261Anpassung für Linux ist trivial.