bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE:Getting numeric ip address string


From: lake
Subject: RE:Getting numeric ip address string
Date: Thu, 2 Jun 2005 11:55:03 +0800

 
IPV4Address ia("127.0.0.1");
char addr[16];
memset(addr,0,16);
strncpy(addr,inet_ntoa(ia.getAddress()),15);

----------
Bug-commoncpp Digest, Vol 28, Issue 1
------------------------------
Message: 8
Date: Tue, 31 May 2005 16:15:52 -0400 (EDT)
From: Ken Sewell <address@hidden>
Subject: Getting numeric ip address string
To: Common C++ mailing list <address@hidden>
Message-ID: <address@hidden>
Content-Type: TEXT/PLAIN; charset=US-ASCII


I've very new to CommonC++ so I apologize if this is addresses elsewhere ( 
if so I haven't been able to find it ).  I'm using the IPV4Address class 
and I'm setting the address, lets say to "127.0.0.1" for this example.  
How can I retrieve this?  The only call that seems to return a string is 
getHostname() which returns "localhost".  Is there a function to return 
the ip address in a string and give me back the original "127.0.0.1"?  
Thanks for any help.

Ken Sewell                   Defense Research Associates
Project Engineer             3915 Germany Lane, Suite 102
937-656-4899 x3004           Beavercreek, Ohio 45431-1608
address@hidden

End of Bug-commoncpp Digest, Vol 28, Issue 1
********************************************





reply via email to

[Prev in Thread] Current Thread [Next in Thread]