Calculate the % of memory saved when bit-fields are used for the following C structure as compared to with-out use of bit-fields for the same structure? (Assuming size of int = 4)struct temp{int a : 1;int b : 2;int c : 4;int d : 4;}s;

🎲 Try a Random Question  |  Total Questions in Quiz: 143  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
C Programming Practice Test: Structures, Unions and Bit-Fields — practice the complete quiz, review flashcards, or try a random question.

Quiz questions on: Structures basics, functions, arrays of structures, pointer to structires, self referential structures, table lookup, typedefs, unions and bit fields. Structures: A structure is a user-defined data type that allows you to group together related data items. For example, you could create a structure to store information about a person, such as their name, age, and address. To declare a structure, you use the struct keyword followed by the name of the structure and a list of its members. Each member of a structure must have a type and a name. Once you have declared a... Show more

Calculate the % of memory saved when bit-fields are used for the following C structure as compared to with-out use of bit-fields for the same structure? (Assuming size of int = 4)<br>struct temp<br>{<br>int a : 1;<br>int b : 2;<br>int c : 4;<br>int d : 4;<br>}s;