thanks, that solved the problem of uint16, but I'm still not sure how to pass my structure to CRC
e.g.
typedef struct header
{
unsigned short s;
unsigned short d;
unsigned int sq;
unsigned int a;
char hdr;
char rs;
char flg;
unsigned short w;
unsigned short cksum;
} header;
typedef struct Message {
struct header hdr;
char data[1024];
}Message;
=================
I need to pass these parameters and find the total CRC then save it in cksum,
no syntax error for my code but I'm getting a segmentation error!