Hey guys,
here's what I am looking to do.
Have an array thats 8 bit.
char [32].
I have a qty, say temp which is 16 bit.
I need qty to hold char [0] in first 8 bits and char[1] in next 8 bits.
Memset is givin me weird errors, so was hoping someone here could show me howto approach this or give me sample memset code.
Thanks for the help.
Depending on your matter you can just define the address of your 16bit variable as the start of your 8 bit array and you will be able to change it by using both variables without to copy the hole thing.
@jsmith
Didnt know about the static_cast operator. Did'nt want to use typecasting as it simply converts the whole var to the typecasted qty.
What i did was cast a struct, typecasted the array to this struc and that way I got my 16 bit structure.
Thanks @jsmith,Duoas and JMC too.