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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

When would you use a pointer to a function?

595


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

611


What are types of functions?

574


What is void main ()?

620


What are the modifiers available in c programming language?

753






Is c still used?

614


Can a variable be both constant and volatile?

572


Explain a pre-processor and its advantages.

639


Give the rules for variable declaration?

686


Define Array of pointers.

644


What is function prototype in c language?

625


What is meant by errors and debugging?

657


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

632


write a proram to reverse the string using switch case?

2477


Is null valid for pointers to functions?

621