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
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is malloc return c?
How can I handle floating-point exceptions gracefully?
What is spaghetti programming?
What is a program?
What is structure and union in c?
Does c have function or method?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
What is the return type of sizeof?
can we implement multi-threads in c.
What are register variables? What are the advantage of using register variables?
Difference between MAC vs. IP Addressing
What is new line escape sequence?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?