【发布时间】:2014-07-09 15:41:33
【问题描述】:
我正在尝试使用数据字节创建 CRC,并且我已经编写了这个函数:
u16 crcGenerate(unsigned char bytes, int len){
u16 crc = 0;
for (int i = 0; i < len; i++){
crc = crc16__computeByteAnsi(crc, bytes[i]); }
return crc;
}
每当调用此函数时,我都会不断收到上述错误,我不太确定如何修复它,甚至不知道出了什么问题。
为避免使这个问题变得臃肿,我已经包含了引用的其他主要 .h 和 .cpp 文件。
This is the Command header file (cmgCOM.h)
This is where the CRCs are computed (crc16.cpp)
This is the primary Command file (cmgCOM.cpp)
我非常感谢我能得到的任何帮助;如果需要提供更多信息,请告诉我。我对 C/C++ 不是很熟悉,也不知道是什么导致了这个问题。
谢谢。
【问题讨论】:
-
您缺少
*。你想要unsigned char *bytes。