Hi
I am trying to allocate a char array of size 1000. This array is passed to a function where it should be filled with the data that has been received from the TCP Socket. The problem occurs then when I try to delete[] buffer: Here I get as a result a User Panic 42. Unfortunately, I do not really see what is going wrong in this simple code fragement...
int main
{
unsigned char *buffer = new unsigned char[1000];
Recv(&buffer);
delete[] buffer;
return (0);
}
void Recv(unsigned char **buffer)
{
TRequestStatus iStatus;
TSockXfrLength len;
TBuf8<1000> buff;
iSocket.RecvOneOrMore( buff, 0, iStatus, len );
User::WaitForRequest(iStatus);
*buffer = ( unsigned char* )buff.Ptr();
}
Thanks for any useful hints!