Noob C questions:
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int
getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res)
void
freeaddrinfo(struct addrinfo *ai)
Taken from http://www.nxmnpg.com/3/getaddrinfo . Namely, I am wondering why this is not just getaddrinfo (char * hostname) and instead is a constant.
I have an idea what a pointer is. It seems to me that almost all functions in C prefer pointers passed only to variables, is this true?
source
share