I would like to input 2 unsigned char variables:a and b. If use a(0) for bit 0 in a, I would like to swap a(6) to a(1) with b(6) to b(1). Finally I wish to get 2 new unsigned char_type variables:a1 and b1 with required bits swapped. I would love to know that is there method to address this issue in C language?
An further requirement is that add 2 variables: pa and pb to decide the start position for the length. For example: if pa=6, pb=7, I have to swap a(6) to a(1) with b(7) to b(2).
Any good solution?
Aha. I get it now