通过套接字发送结构:错误代码2664:' int send(SOCKET,const char *,int,int)':不能转换参数2来自' TCHAR *'到#char; char *'

时间:2017-12-06 03:30:21

标签: c++ sockets visual-studio-2015 winsock2

我是编码的新手。我在Windows系统上使用Visual Studio 2015进行编码,代码语言是c ++

我在套接字版本2中使用WinSock2标头

我需要从服务器向客户端发送一个结构,但我无法这样做?

BaseRepository repo = new BaseRepository();
using (SqlConnection con = new SqlConnection(repo.connectionString))

在main()函数中  构建套接字连接后,连接到客户端并创建结构对象 我将其作为

发送
    typedef struct{
        int a;
        float b;
        string c,d;
    } Mystructure;

但是编译器说 ERROR代码2664:' int send(SOCKET,const char *,int,int)':不能转换来自' TCHAR *'到' const char *'

0 个答案:

没有答案