I was studying about socket programming using C. In the header file netinet/in.h there is this code
struct in_addr
{
in_addr_t s_addr;
};
and this structure is used in the following structure.
struct sockaddr_in
{
short sin_family; /* must be AF_INET */
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8]; /* Not used, must be zero */
};
What could be the reason of creating in_addr structure, while they could have just used it as a normal variable?