I'm studying socket programming and I learned inet_addr function. But I'm confused how can I handle in_addr_t type.
inet_addr function returns in_addr_t type which is uint32_t, then do I have to use uint32_t type variable to handle it?
In the book, example handles it as unsigned long type, but I don't understand why this way is used.
unsigned long conv_addr = inet_addr(addr1); // unsigned long == uint32_t?
You do not have to use
uint32_tto handle the value returned frominet_addr. You can use any type that can represent any value that might be returned or that you might use in a calculation. But why not use theuint32_tor thein_addr_ttype?