I want to calculate the broadcast address for:
IP: 192.168.3.1 Subnet: 255.255.255.0 = 192.168.3.255
in C.
I know the way
Just calculate:
broadcast = ip | ( ~ subnet )
(Broadcast = ip-addr or the inverted subnet-mask)
The broadcast address has a 1 bit where the subnet mask has a 0 bit.
1
0