Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in_addr_t to string

I have an IP address stored in in_addr_t and I want to create the corresponding string representation of this data type (e.g. in_addr_t to 10.0.0.1).

How can I do that?

like image 587
cateof Avatar asked Sep 22 '10 10:09

cateof


1 Answers

Use inet_ntop() - convert IPv4 and IPv6 addresses from binary to text form.

like image 123
James Anderson Avatar answered Oct 11 '22 19:10

James Anderson