So I know generally how to use bit-wise functions, but I cannot figure out how to do this...

I want to change \/

10100000000000000110001100100000 (num1)

to \/

10100000000000000110001100001000 (num2)

The whole thing remains unchanged except for that one piece. I do not know how to do that using the & and | functions. This isn't so much of a programming problem I guess as to a logic problem. I am simply replacing the value at one address with a 0, and putting a value in another address. And I have no idea how to do it.

This is not homework, I need it at work and have not done bitwise for a very long time.

I was thinking something like this...

Shift 32 1's onto a num3 (num3 = 0xffffffff)

Shift on 00 (size of each data point in the number)

Shift over x number of 1's, so the 00's line up with the data to be wiped out

Do num1 & num3 to wipe out that spot (num1=num1&num3)

Do the same thing only mask with 0's and put in the desired value instead of 00

Move over until the wanted value lines up

do an num1 | num3 and now num3 is in. (num1=num1|num3)

The problem is I do not know how to do the shifting to make this all work. Or how push 1's and 0's on. Can someone point me in the right direction? Thanks