I´m trying to make a checksum of the content in a datapacket struct and want to make sure I get it right. Let´s say that the struct have three variables where on is an array like this:
Should I then make the checksum like this?Code:typedef struct {
char a;
char b;
char c[10];
} DataPacket;
Code:char checksum;
checksum = a ^ b;
for(i = 0; i < sizeof(c); i++){
checksum ^= c[i];
}