C语言在线http://codepad.org-创新互联
校验和计算:
文章题目:C语言在线http://codepad.org-创新互联
浏览路径:http://azwzsj.com/article/ddogis.html
#include
#define u8 unsigned char
#define u16 unsigned int
unsigned char CalculateChecksum(const u8 *pData, u16 Length)
{
u8 byChecksum = 0xff;
u16 i;
for (i = 0; i
return byChecksum;
}
void main()
{
unsigned char checksum;
unsigned char aa[]={0x04, 0x00, 0x1E, 0x20};
checksum = CalculateChecksum(aa,4);
printf("%x",checksum );
}
文章题目:C语言在线http://codepad.org-创新互联
浏览路径:http://azwzsj.com/article/ddogis.html