what is the use of bitfields & where do we use them?

Answers were Sorted based on User's Feedback



what is the use of bitfields & where do we use them?..

Answer / naveen shukla

Bit field is an idiom used in the computer programming
language to store a value as a short series of bits .
It is most commanly used when we know the fix width of int
type variable to be used .

Is This Answer Correct ?    4 Yes 1 No

what is the use of bitfields & where do we use them?..

Answer / rams

Bit fields are used to restrict the size of a structure member. we can reduce the size of a structure member as a result no wastage of bits. suppose if i want to store date generally it is between 1 to 31 we can store it in 5 bits only.

bit fields can be used only with in structure.

ex:struct st
{
char date:5;
};

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

write a c code "if you give a any decimal number then print that number in english alphabet"? ex: i/p: 552 o/p: five hundred fifty two ...

1 Answers   Philips,


Define VARIABLE?

0 Answers   ADP,


Can you mix old-style and new-style function syntax?

0 Answers  


what's the return value of malloc()

9 Answers  


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

0 Answers  






How can you allocate arrays or structures bigger than 64K?

0 Answers  


write a c program to change only the 3rd bit of the particular number such that other bits are not affected.. if bitnum=10(say.. it can be any no..

10 Answers   Bosch, Mind Tree,


can we implement multi-threads in c.

0 Answers  


prog for 1st five prime numbers in 2^x - 1

0 Answers  


What is the process to create increment and decrement stamen in c?

0 Answers  


What is c standard library?

0 Answers  


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

0 Answers  


Categories