I recently came across some third-party C # encoders that do the following:
public int RecvByteDataFromPrinter(ref byte[] byteData)
{
byte[] recvdata = new byte[1024];
byteData = recvdata;
return SUCCESS;
}
What does the " byteData = recvdata" line do in this case?
It seems like the goal is to have byteData the contents of the contents of the recvdata array. However, I got the impression that you need to perform an operation Array.Copy(...)for this to happen.
Is this really a byteData link change to point to a newly allocated array? If so, is this array guaranteed?
source
share