Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can you tell whether a program was compiled using c versus c++?

1044


What is the difference between ā€˜g’ and ā€œgā€ in C?

3911


What are extern variables in c?

949


What is ctrl c called?

1002


What is optimization in c?

948


Explain what is a stream?

1032


What is NULL pointer?

1040


write a program to find out prime number using sieve case?

2036


Differentiate between #include<...> and #include '...'

1004


What is modifier & how many types of modifiers available in c?

983


What does c mean before a date?

1104


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1089


is it possible to create your own header files?

1045


Explain how can you determine the size of an allocated portion of memory?

1041


ATM machine and railway reservation class/object diagram

5191