I want to toggle a bit at a given 'offset', I have tried by using typedef to create a new type as "BYTEBUF" and its variable as bitstream. ...
typedef struct{
char *data;
unsigned int nb_bytes;
unsigned long bitlength;
}BYTEBUF;
this is my typedefinition
i want to toggle the bit at a given offset,
i tried using :
bitstream->data[offset]^=1
but many suggest that instead of "offset" it should be "offset/8".
(this is my first question so pls bare for any mistakes)