关于C++ socket编程出错的问题
errorC2664:'connect':cannotconvertparameter2from'structsockaddr_in*'to'conststructsoc...
error C2664: 'connect' : cannot convert parameter 2 from 'struct sockaddr_in *' to 'const struct sockaddr *'
出错代码:
if(connect(client,(SOCKADDR_IN*)&clientService,sizeof(clientService))==SOCKET_ERROR)
{
printf("Failed to connect.\n");
WSACleanup();
return;
}
代码是网上下的,链接如下:http://wenku.baidu.com/link?url=30ail29DngZrKsQETULcSGVMNjQBAhZUFv288nNkQJF1ncU7EtLygabvU0f4FfgO4VcyEe6R4CPq00TJBQ5PI7vS2oV9rLa8CDEysQ4FV3G
不胜感激! 展开
出错代码:
if(connect(client,(SOCKADDR_IN*)&clientService,sizeof(clientService))==SOCKET_ERROR)
{
printf("Failed to connect.\n");
WSACleanup();
return;
}
代码是网上下的,链接如下:http://wenku.baidu.com/link?url=30ail29DngZrKsQETULcSGVMNjQBAhZUFv288nNkQJF1ncU7EtLygabvU0f4FfgO4VcyEe6R4CPq00TJBQ5PI7vS2oV9rLa8CDEysQ4FV3G
不胜感激! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询