et pour etre un peu plus precis, voila mon bout de code et les erreurs :
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdio.h>
int main() {
struct addrinfo *result = NULL,*ptr = NULL,hints;
ZeroMemory( &hints, sizeof(hints) );
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = AI_PASSIVE;
// Resolve the local address and port to be used by the server
int iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result);
if ( iResult != 0 ) { printf("getaddrinfo failed: %d\n", iResult); WSACleanup(); return 1; }
return 0;
}
ERREURS :
'hints' uses undefined struct 'addrinfo'
left of '.ai_family' must have class/struct/union type
left of '.ai_socktype' must have class/struct/union type
left of '.ai_protocol' must have class/struct/union type
left of '.ai_flags' must have class/struct/union type
'AI_PASSIVE' : undeclared identifier
'getaddrinfo' : undeclared identifier
'DEFAULT_PORT' : undeclared identifier
Voila
______________________
Adeon, programmeur de jeux sur directX 9 (
[ Lien ]) a votre service !