bsnowman17 Distinguished Dec 7, 2010 74 0 18,630 Jul 8, 2011 #1 bit_X = ((byte_Y & 0x80) ? 1 : 0); Could someone explain what is happening here? X is a bit Y is a byte
bit_X = ((byte_Y & 0x80) ? 1 : 0); Could someone explain what is happening here? X is a bit Y is a byte
Solution Ijack Jul 8, 2011 The expression on the right tests whether the leftmost bit of byte_Y is set. If so it sets bit_X to 1, otherwise it sets it to 0. byte_Y & 0x80 Is the test (0x80 is 10000000 in binary). (A ? 1 : 0) Is the conditional.
The expression on the right tests whether the leftmost bit of byte_Y is set. If so it sets bit_X to 1, otherwise it sets it to 0. byte_Y & 0x80 Is the test (0x80 is 10000000 in binary). (A ? 1 : 0) Is the conditional.
Ijack Splendid Jul 30, 2008 7,098 0 28,010 Jul 8, 2011 Solution #2 The expression on the right tests whether the leftmost bit of byte_Y is set. If so it sets bit_X to 1, otherwise it sets it to 0. byte_Y & 0x80 Is the test (0x80 is 10000000 in binary). (A ? 1 : 0) Is the conditional. Upvote 0 Downvote Solution
The expression on the right tests whether the leftmost bit of byte_Y is set. If so it sets bit_X to 1, otherwise it sets it to 0. byte_Y & 0x80 Is the test (0x80 is 10000000 in binary). (A ? 1 : 0) Is the conditional.
bsnowman17 Distinguished Dec 7, 2010 74 0 18,630 Jul 8, 2011 #3 Best answer selected by bsnowman17. Upvote 0 Downvote
Dark Lord of Tech Retired Moderator Aug 18, 2009 128,666 1,804 159,590 Jul 8, 2011 #4 This topic has been closed by Area51reopened Upvote 0 Downvote