Answer Posted / nakul sharma
Memory allocated for any structure is equal to the sum of
memory required by each structure member.
Example: In a structure 'abc' below, memory allocated will
be 7 Bytes (2 Bytes for int a + 1 Byte for char b + 4 Bytes
for float c ina 32 bit processor)
struct abc
{
int a;
char b;
float c;
}
But in union memory allocated for it is equal to the memory
required by the biggest (in terms of memory it use) union
member.
Example: In a union 'abc' below, memory allocated will be 4
Bytes as float c is the biggest union member here and it
uses 4 Bytes of memory in 32 bit processor.
union abc
{
int a;
char b;
float c;
}
Is This Answer Correct ? | 19 Yes | 1 No |
Post New Answer View All Answers
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is time complexity c?
Why do we use & in c?
Why do we use null pointer?
List some applications of c programming language?
Explain threaded binary trees?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
What is a pointer on a pointer in c programming language?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What are extern variables in c?
What is identifier in c?
What is static memory allocation?
What should malloc(0) do?
Is c still relevant?
Explain setjmp()?