[ale] Storing IP Addresses

stephen stephen at phynp6.phy-astr.gsu.edu
Sun Nov 4 22:32:50 EST 2001


On Wed, Sep 19, 2001 at 10:05:57PM -0400, Christopher Fowler wrote:
> I need a little help getting IPs I store in a config out.
> 
> Currently I store them in char ip[4].
> 
> ip[0] = 192
> ip[2] = 168
> ip[3] = 2
> ip[4] = 230
> 
> 
> I access them the same way and it is somewhat painful.  Is there a better
> way?  How can I treat the IP address as a 32bit integer?

Why not use 'struct in_addr' in <netinet/in.h>?

stephen

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list