I am trying to emulate some C++ code in C#. I am not familiar with the intricate workings of C++ and don't quite understand how to implement this code in C#.
Could someone please explain what the functions are doing and what their output would be in ASCII? In particular, I do not understand what the "memcpy" method is doing the way this code is written.
//example values
str = "<Request Type="Query" Version="1.0"></Request>"
uintcrc = getCrc(str, strlen(str));
//code i don't understand
//create a byte array with a null terminator?
memset(strQueryBuffer, '\0', sizeof(str));
//print the values into the byte array
sprintf(strQueryBuffer, "%c%s%c", COMM_STX, str, COMM_ETX);
//append the uintcrc to the end of the byte array?
memcpy(strQueryBuffer + strlen(strQueryBuffer), &uintcrc, sizeof(uintcrc));