Posted on 1998-12-04
I am trying to write a function that accepts two strings,
an ip address and a netmask, and returns another string,
which is the subnet calculated from the two input parameters.
first i convert the two strings to ip addresses
using inet_addr(ip) and inet_addr(subnet)
then i use the & operation to get the netmask in
an unsigned int format, but I don't know how to
convert that back to a string.
Is it possible to do that conversion, or am I completely
off topic here ???
Does anybody know of any code that does this successfully ?