hi there,
I have two header files
Form.h and serial.h
in Form.h I declare and call a class like this:
CRC df1; // define class
crc = df1.CHECK(crc,buffer[6]); // use method in the class
serial.h
class CRC {
public:
int x,y;
unsigned char CHECK (unsigned char cPrev, unsigned char cNext)
{
unsigned char cNew = (cPrev << 1) & 0xFF;
if(cPrev & 0x80)
{
cNew --;
}
cNew ^= cNext;
return cNew;
}
};
when I compile this it runs it but when I debug it it seems never to call the method CHECK can anyone explain what I do wrong?
it seems never to get to the method CHECK I have checked this with a break point
Many thanks:-)
You must be mistaken somehow. It must be calling the function.
The only way it's not calling the function is if it's not getting to that crc = df1.CHECK(crc,buffer[6]);
line.
I'd need to see more code to diagnose further.
the crc = df1.CHECK(crc,buffer[6]); line is called for sure I stepped trough it with the debugger;