What are bit fields? What is their use?
Answers were Sorted based on User's Feedback
Answer / ravi joshi
Bit fields can only be declared inside a structure or a
union, and allow you to specify some very small objects of a
given number of bits in length. Their usefulness is limited
and they aren't seen in many programs, but we'll deal with
them anyway.
Is This Answer Correct ? | 6 Yes | 0 No |
Bit fields main intention is to reduce the memory
consumption.
Syntax:
------
struct
{
int a:1;
/*whatever may be the size of the int(compiler dependent),
only one bit shall be allocated for variable 'a'*/
}BITFIELDS;
Restictions:
------------
1. Accessing or printing address of bitfield variable is
not possible.
2.Array of bit fields, not possible.
3.A function cannot return a bit field variable.
Is This Answer Correct ? | 1 Yes | 1 No |
Explain what is operator promotion?
How can I read in an object file and jump to locations in it?
Subtract Two Number Without Using Subtraction Operator
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
Why is c used in embedded systems?
write a c program to calculate the income tax of the employees in an organization where the conditions are given as. (I.T. = 0 if income <100000 I.T = 10% if income _< 200000 it = 20% if income >_ 200000)
7 Answers Consultancy, DBU, FD, JK Associates, Kobe, Satyam,
Explain how do you list a file’s date and time?
Differentiate between null and void pointers.
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
What are the functions to open and close file in c language?
Explain the properties of union.
Do you know what are bitwise shift operators in c programming?