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 own function for strstr

1 Answers   LG Soft,


What does void main return?

0 Answers  


du u know test pattern for robosoft? Plz share

1 Answers   RoboSoft, TATA, Wipro,


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

0 Answers   HCL,


How can I open files mentioned on the command line, and parse option flags?

0 Answers  


What is variable initialization and why is it important?

0 Answers  


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

0 Answers  


Is there any book to know about Basics of C Language?

4 Answers  


What is the difference between union and anonymous union?

0 Answers   Hexaware,


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

0 Answers  


When should you not use a type cast?

0 Answers  


1. What is the output of printf("%d") 2. What will happen if I say delete this 3. Difference between "C structure" and "C++ structure". 4. Diffrence between a "assignment operator" and a "copy constructor" 5. What is the difference between "overloading" and "overridding"? 6. Explain the need for "Virtual Destructor". 7. Can we have "Virtual Constructors"? 8. What are the different types of polymorphism? 9. What are Virtual Functions? How to implement virtual functions in "C" 10. What are the different types of Storage classes? 11. What is Namespace? 12. What are the types of STL containers?. 13. Difference between "vector" and "array"? 14. How to write a program such that it will delete itself after exectution? 15. Can we generate a C++ source code from the binary file? 16. What are inline functions? 17. Talk sometiming about profiling? 18. How many lines of code you have written for a single program? 19. What is "strstream" ? 20. How to write Multithreaded applications using C++? 21. Explain "passing by value", "passing by pointer" and "passing by reference" 22. Write any small program that will compile in "C" but not in "C++" 23. Have you heard of "mutable" keyword? 24. What is a "RTTI"? 25. Is there something that I can do in C and not in C++? 26. Why preincrement operator is faster than postincrement? 27. What is the difference between "calloc" and "malloc"? 28. What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"? 29. What is Memory Alignment? 30. Explain working of printf. 31. Difference between "printf" and "sprintf". 32. What is "map" in STL? 33. When shall I use Multiple Inheritance? 34. What are the techniques you use for debugging? 35. How to reduce a final size of executable? 36. Give 2 examples of a code optimization.

2 Answers  


Categories