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
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
What is a structure and why it is used?
how can f be used for both float and double arguments in printf? Are not they different types?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Explain the use of 'auto' keyword
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
What is the difference between typedef and #define?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Why is c called a structured programming language?
What does the c preprocessor do?
Explain data types & how many data types supported by c?
How will you write a code for accessing the length of an array without assigning it to another variable?
What does the error 'Null Pointer Assignment' mean and what causes this error?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
Is c compiled or interpreted?