Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/10/12 04:48
Read: 1508 times


 
Msg Score: -1
 -1 Looks like homework
#188286 - Different variable bit merge into single variable?
Hello friends,

I have doubt regarding C programming.
i have 2-3 variable(8bit), i want to merge individual bits into another single variable.

for example:

var1 => D7 D6 D5 D4 D3 D2 D1 D0
var2 => D7 D6 D5 D4 D3 D2 D1 D0
var3 => D7 D6 D5 D4 D3 D2 D1 D0

CAN I MERGE FEW BITS OF EACH VARIABLE INTO SINGLE VARIABLE ?

MEANS.........

final_var => D7 D6 D5 D4 D3 var3.D6 var2.D4 var1.D7

D0,D1,D2 of final_var is now D7 of var1, D4 of var2 and D6 of var3, respectively
i want to access (r/w) thouse bits via final_var variable......
is it possible?

List of 11 messages in thread
TopicAuthorDate
Different variable bit merge into single variable?      Yagnesh Mehta      09/10/12 04:48      
   Of course      Per Westermark      09/10/12 05:02      
      its bit addressable....      Yagnesh Mehta      09/10/12 05:38      
         No      Per Westermark      09/10/12 06:39      
            just want to check...      Yagnesh Mehta      09/10/12 22:16      
               What was missing in the answers you have already received?      Per Westermark      09/11/12 00:21      
                  no defined bit order      Maarten Brock      09/11/12 03:26      
                     Just use C expression      David Prentice      09/11/12 05:39      
         what is wrong with IE?      Erik Malund      09/10/12 07:01      
            Right!!!!!!!!!!      Yagnesh Mehta      09/13/12 00:29      
               gobbledygook      David Prentice      09/13/12 05:09      

Back to Subject List