// test1.c
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
#pragma lib "ws2_32.lib"
int main(void)
{
WSADATA wsaData;
WORD version = MAKEWORD(1, 1);
if (WSAStartup(version, &wsaData) != 0)
exit(1);
printf("testing...\n");
/* begin messing up */
int errorcheck;
struct addrinfo hints, *servinfo, *p;
memset(&hints, 0, sizeof hints);
hints.ai_family=AF_UNSPEC;
hints.ai_socktype=SOCK_STREAM;
hints.ai_flags=AI_PASSIVE;
if ((errorcheck=getaddrinfo(NULL, "80", &hints, &servinfo)) != 0)
exit(1);
/* end messing up */
WSACleanup();
return 0;
}
John