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 |
The program to allow the characters from the input received and send this function to a function check if the characters between letters a to z is a function of y joins as the characters main and output to otherwise return to the original function of the y characters
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Is the C language is the portable language...If yes...Then Why...and if not then what is problem so it is not a Portable language..???
Is there a way to switch on strings?
What is the scope of local variable in c?
How can I read a directory in a C program?
2 Answers Bright Outdoor, Wipro,
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
If the static variable is declared as global, will it be same as extern?
What is integer constants?
Write a function to find the area of a triangle whose length of three sides is given
Why is #define used?
We can draw a box in cprogram by using only one printf();& without using graphic.h header file?