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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/03/09 13:26
Read: times


 
#161996 - Just use plain C.
Responding to: ???'s previous message
/* Set bit designated by index. */
var1 = var1 | ((unsigned char) 1 << index);

/* Clear bit designated by index */ 
var1 = var1 & ~((unsigned char) 1 << index); 

/* Copy bit designated by index to result. */
if(var1 & ((unsigned char) 1 << index))
    {
    result = 1;
    }
else
    {
    result = 0;
    }


 


List of 6 messages in thread
TopicAuthorDate
C51 compiler - Writing to a bit, using an index            01/01/70 00:00      
   Note that ^ also represents xor            01/01/70 00:00      
      Ouch!!!            01/01/70 00:00      
         Is there a way to use a pointer to access a bit            01/01/70 00:00      
         Just use plain C.            01/01/70 00:00      
            Just use plain C            01/01/70 00:00      

Back to Subject List