[ale] Storing IP Addresses

Vaidhy Mayilrangam vaidhy at loonys.net
Sun Nov 4 22:10:12 EST 2001


Store it as a hex number.. the max value is FFFFFFFF :)

Vaidhy
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?
> 
> Thanks,
> Chris
> 
> 
> ---
> 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.
> 
> 

---
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