该程序编译失败
如下程序用破解版VC6编译失败。#include<stdio.h>
#include<winsock2.h>
#include<fstream>
#include<iostream>
using namespace sd;
void main()
{
int Client;
int Client2;
fstream Client2;
ofstream Client2;
Client2.open("clienthost.cfg");
Client2>>Client;
Client2.Close
SOCKET Sender;
InitWinsock();
struck sockaddr_in server;
int len =sizeof(server);
server.sin_family=AF_INET;
server.sin_port=htons(1037);
server.sin_addr.s_addr=inet_addr(%d,&Client);
Sender=socket(AF_INET,SOCK_DGRAM,0);
while(1)
printf("请输入要发送的数据,回车后将数据发送到 %d 计算机中。若要调出输入法,请同时按下Ctrl+空格键,或按下Ctrl+Shift。",&Client);
scanf("%s",buffer);
if(sendto(Sender,buffer,sizeof,buffer,0,(struct sockaddr*)&server,len)!=SOCKET_ERROR)
{
printf("发送成功!");
if(recvform(Sender,buffer,sizeofbuffer,0,(struct,sockaddr*)&server,&len)!=SOCKET_ERROR)
msgbox(NULL,buffer,"来自远程计算机发送的消息",MB_OK);
}
}
closesocket(socket1);
}
int Error;
WORD VersionRequested;
WSADATA Wsadata;
VersionRequested=MAKEWORD(2,2);
Error=WSAStartup(VersionRequested,&Wsadata);
if(Error!=0)
{
return FALSE;
}
else
{
if(LOBYTE=(Wsadata.wVersion)!=2||HIBYTE(Wsadata.wHighVersion)!=2)
{
WSACleanup();
return FALSE;
}
}
return TRUE;
}