c++ - How to convert standard IP address format string to hex and long? -


Do anyone know how to get an IP address in decimal or hex from the standard IP address format string ("xxx.xxx .xxx .xxx ")?

I tried to use the inet_addr () function but I could not find the correct result.

I tested it on "84.52.184.224"

P>

returned the function 3770168404 which is not correct (the correct result is 1412741344).

Thank you!

Use Huntlal, Etcons, Enthohall, NTUs Functions to change between network and local byte order can be done.


Comments