I've got a quick question; I have an IPv4 in a C string (say "192.168.0.1") and I want to convert it to an uint32_t. I'm sure there should be some function for that but I havn't found it. Any ideas?
相关问题
- Multiple sockets for clients to connect to
- Is shmid returned by shmget() unique across proces
- What is the best way to do a search in a large fil
- Inheritance impossible in Windows Runtime Componen
- glDrawElements only draws half a quad
The function is called
inet_aton
.The structure in_addr is defined in
<netinet/in.h>
as:Of course you can also use the newer function
inet_pton
.