Hi,
What i'm trying to write a code that would allow me change a single bit of a variable. So I've tried to store it in an array so that its possible for me to change a single bit of the variable by simply changing the value of the array index.
However this doesn't seem to work. See extract of code below.
Help please...ideas, suggestions?
What i'm trying to write a code that would allow me change a single bit of a variable. So I've tried to store it in an array so that its possible for me to change a single bit of the variable by simply changing the value of the array index.
However this doesn't seem to work. See extract of code below.
Help please...ideas, suggestions?
Code:
typedef u_int32_t UInt32; UInt32 value = 0xFFFFFFFF; int index = 4; UInt32* var = new UInt32[32]; *var = value; var[index] = 0; cout<<hex<<*chan<<endl;
Comment