Possible Duplicate:
Linux / C++: Get the IP Address of local computer
I'm porting a software made in java with the and the local address for the socket is needed. I'm looking for a equivalent for the lines:
Socket socket;
...
InetAddress internal = socket.getLocalAddress();
String localIp = internal.getHostAddress();