incompatible types when creating thread in Windows

前端 未结 1 889
无人共我
无人共我 2021-01-16 19:23

I have created an app in which I want a thread to handle listen-UDP separately and make me a buffer, but when I try to pass it to thread it says there are compatibility issu

1条回答
  •  走了就别回头了
    2021-01-16 19:42

    Try below code that might help you..

    DWORD start(LPVOID lpdwThreadParam)
    {
        buffer_t *buffer = (buffer_t *)lpdwThreadParam; //Type cast your argument here
        SOCKET s;
        struct sockaddr_in server, si_other;
        int slen, recv_len;
        char buf[BUFLEN];
        WSADATA wsa;
        ...
    }
    

    0 讨论(0)
提交回复
热议问题