Ok, before posting this question, I checked the topics here in_addr_t for the string
my question is different.
I understand that the inet_ntoa function has the following type
char * inet_ntoa (struct in_addr in);
I want to know what in_addr_t
what will the representation be when it is used in the socket program.
I checked the structure definition in <netinet/in.h>
typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; };
has type above. I do not want to print in_addr_t in char *, as inet_ntoa does. I want to see what in_addr_t.So is, how it can be done or what exactly in_addr_t is and why it is used again and again in socket programming. If I am not mistaken, it is defined as
typedef uint32_t in_addr_t;
So if in_addr_t is an unsigned 32 bit int, I want to see what it is, not a char * that prints 192.168.1.1 output to stdout.
Registered User
source share