Determine if a string is a valid IP address in C -
What would be a good way to determine whether a string contains an IP address or not Should I use isdigit () ?
I asked you to be able to use a slightly modified (C) version which I along came.
bool isValidIpAddress (char * ipAddress) {struct sockaddr_in sa; Favored Results = Inset_EPTAN (AFINETET, IPADress, and (SASIDAR)); Return results! = 0; } To use the function, you must enter #include & lt; Arpa / inet.h & gt; will be required.
For an update question based on comments: If you want to know that the C-style string in is an IP address, then you should add two answers given so far .
Comments
Post a Comment