Just like the docs say, I included a minimal example. When all goes well, 0 is returned, else -1 is returned.
struct in6_addr output;
// READ THE INPUTSTRING INTO INPUT
if(inet_pton(AF_INET6, input, &output)) //Parse input to a binary IPv6 address in output.
// use your binary IPv6 address called output