I have a function that calculate a 32 bit CRC,
I have an internal variable to a class that hold the CRC.
the function that validate CRC consistency return a boolean result of the class CRC with what the class is calculating,
the member function inside the class does the next,
save the CRC into a temp variable, calculate CRC then compare the two values.
bool X::CRCisMatching()
{
unsigned long tmpCRC = ClassCRC;
ClassCRC = GetNewCalculatedCRC();
printf("comparing %08x ~ with ~ %08x!\n", tmpCRC, ClassCRC);
return tmpCRC == ClassCRC;
}
the issue is that I get this output,
comparing AB44CD2A33 ~ with ~ AB44CD2A33
why I am getting 10 values instead of 8 as intended with %08x
did anyone face any similar problem before??
btw, I am using a 32 bit machine