February 25th, 2013, 05:50 AM
How to read IP address from a text file in C
How to read IP address from a text file and how to process the ip address and which data type is used to store the Ip address..
February 25th, 2013, 05:54 AM
Take a look at Tutorial: C File I/O and Binary File I/O
Also here is another example:
Now, how you process the IP address depends on the structure of the data in your file.
Last edited by dariyoosh; February 25th, 2013 at 05:56 AM.
February 25th, 2013, 09:01 AM
IP V6 and V4 addresses have different formatting conventions and when stored as an address rather than a string, different data types to.
inet_pton() converts an IPV4 and IPV6 addresses in "digits and dots" or "hex and colon" form to an in_addr or in6_addr structure.