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 is self-referential structure in c programming?
what is bit rate & baud rate? plz give wave forms
c program to compute AREA under integral
Differentiate between functions getch() and getche().
can anyone suggest some site name..where i can get some good data structure puzzles???
Why is c still so popular?
What is the difference between formatted&unformatted i/o functions?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
What is a null pointer in c?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
What is the usage of the pointer in c?
Explain how can you restore a redirected standard stream?
Is there a built-in function in C that can be used for sorting data?
Explain what are the __date__ and __time__ preprocessor commands?