C# で C++ コードをエミュレートしようとしています。私は C++ の複雑な仕組みに慣れておらず、C# でこのコードを実装する方法をよく理解していません。
誰かが関数が何をしているのか、そしてそれらの出力がASCIIでどうなるかを説明してもらえますか? 特に、このコードの書き方では「memcpy」メソッドが何をしているのかわかりません。
//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));