Hi,
I am unable to assign value zero to my variable which is defined as unsigned char.
typedef struct ABCD
{
unsigned char abc[6];
unsigned char def;
unsigned char ghi;
} ABCD;
typedef ABCD *PABCD;
In my Por*C code, i assign the values using memcpy like below
void abc(PABCD s_tag)
{
memset((char*)(s_tag), '0',sizeof(s_tag));
memcpy((char*)s_tag.abc,"000000",sizeof(s_tag.abc));
s_tag.def = 0;
s_tag.ghi=0;
}
In debug mode, i could see '\0'.....How to make the value as '0' only:confused:?
(dbx) print -L *s_tag
*s_tag = {
s_tag.abc = "000000"
s_tag.def = '\0'
s_tag.ghi = '\0'
}