Hi Oliver,
Welcome to the forum!
There are a few bugs in that example code, thanks for bringing this to our attention. I've fixed the FAQ, and here's what the code should have been:
Code:
if(c.con)
{
Ice::ConnectionInfoPtr info = c.con->getInfo();
Ice::TCPConnectionInfoPtr tcpInfo =
Ice::TCPConnectionInfoPtr::dynamicCast(info);
if(tcpInfo)
{
cout << "local address = " << tcpInfo->localAddress << ":"
<< tcpInfo->localPort << endl;
cout << "remote address = " << tcpInfo->remoteAddress << ":"
<< tcpInfo->remotePort << endl;
}
}
I've verified that this compiles. 
Let us know if you still have questions.
Regards,
Mark