请教!哪位朋友帮忙把C语言代码转为C#语言,谢谢!
有一个C语言的低位校验代码想转换成C#语言的没搞通。请大神帮忙转化一下,谢谢!uint_8 ucCalculateChecksum(uint_8* pcCommandString)
{
uint_32 uiRunningTotal = 0;
uint_32 i;
/*Calculate checksum*/
for (i = 0; i < strlen(pcCommandString); i++)
{
/*Add character to running total*/
uiRunningTotal += (uint_32)pcCommandString[i];
}
/*Mask the lower byte and return the value to the caller*/
return (uint_8)(uiRunningTotal & 0xFF);
}
[此贴子已经被作者于2021-11-7 12:49编辑过]