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 |
What is the difference between malloc() and calloc()?
What is the general form of #line preprocessor?
write a program for odd numbers?
What is the right way to use errno?
how to copy a string without using c function
is assignment operator is arithmatic or not
1.)how to find d most repeated word in a string? string ="how do you do"?? output should be do
1 Answers AAS, Nagarro, Vuram,
What does %c mean in c?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
What is define c?
write a program to search for an element in a given array. If the array was found then display its position otherwise display appropriate message in c language
what is the syallabus of computer science students in group- 1?