That line declares multiple variables in one line. It's the same thing as this
struct addrinfo *result = NULL;
struct addrinfo *ptr = NULL;
struct addrinfo hints;
Programmers set pointers to NULL so that if you accidentally dereference them, you'll throw an exception and find your error. If you don't initialize them, they'll point to junk which can cause your application to crash in devious manners.