#include #include #include #include #include #include #include #include #include #include #include #include _cdecl main(int argc, char **argv) { WSADATA wsaData; char hostName[256]; WSAStartup( MAKEWORD(1, 1), &wsaData ); if ( !gethostname( hostName, 256 ) ) { printf( "\nHost name is %s\n", hostName ); } else { printf( "\nNo host name.\nError: %d", WSAGetLastError() ); } WSACleanup(); return( 0 ); }