Ok i found the problem
std::string GetData(SOCKET sock) {
char buf[1024];
int bytesReceived = recv(sock, buf, 1024, 0);
if (bytesReceived == SOCKET_ERROR)
std::cout << "SOCKET ERROR (GETDATA())\n";
IsExit = true;
return std::string(buf, 0, bytesReceived);
}
It works when i fix the {}
std::string GetData(SOCKET sock) {
char buf[1024];
int bytesReceived = recv(sock, buf, 1024, 0);
if (bytesReceived == SOCKET_ERROR) {
std::cout << "SOCKET ERROR (GETDATA())\n";
IsExit = true;
}
return std::string(buf, 0, bytesReceived);
}
Thanks 0x0aAA for the help