I have no idea why is that happening – when ever I call this function I have and send TCP messages to the client, I’ve got this:
Run-Time Check Failure #2 – Stack around the variable ‘ToSend22’ was corrupted.
Whenever the client is disconnected. ToSend22 is STD string which I am doing
const char *ToSend288 = ToSend22.c_str();
Client.Send(ToSend288, ToSend22.size());
Why is that happening? Thanks.
Most probably
Client.Sendis modifying thechar*buffer you are passing to it.Or other local variable in same function is being overwritten somehow, which is affecting
ToSend22variable. Array or pointer mis-use is definitely involved in this function.Please post some more code.