How can I get Single byte from 'int' type variable? Can we
alter single bit or multiple bits in int type variable? if so,
How?
Answer Posted / hassan noureddine
Use bit wise unary commands:
int i = 0x5678
char LowByte = (char) i; // yield 8;
To alter the bits
i &= 0xFF; // reset upper 2 bytes
i ^= 0xFFFF // invert all bits
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What does s c mean on snapchat?
Explain how can you avoid including a header more than once?
Explain the difference between getch() and getche() in c?
What is the purpose of type declarations?
Why void main is used in c?
What will be the outcome of the following conditional statement if the value of variable s is 10?
What is data type long in c?
What is #include stdio h?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is far pointer in c?
What are the disadvantages of external storage class?
Which is the best website to learn c programming?
What is #ifdef ? What is its application?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Explain high-order bytes.