Possible Duplicate:
IPv6 parsing in C
I need to check strings if they are valid IPv6 addresses in C++.
There are elegant solutions for C# here and rather ugly regex here.
Is there a good way to do this in C++ ?
I'm currently using this, but it doesn't work on Windows XP (inet_pton() is missing):
unsigned char buf[sizeof(struct in6_addr)];
bool isvalid= inet_pton(PF_INET6, (const char *)addr, buf);