let's take a code
struct FAQ
{
int a;
char b;
float c;
double d;
int a[10];
}*temp;
now explain me how the memory will be allocated for the
structure FAQ and what address will be in the structure
pointer (temp)....................
Answer Posted / vrushali
Memory allocated will be word aligned in nature.
e.g. for int the address would be allocated as a multiple of
4 .... Next char would start the n+1 where n = multiple of 4.
Similarly next....
when we do sizeof structure we get 60 bytes...
But originally , it should be
4 + 1+ 4+ 8 + 4 *10 = 57 bytes.
The extra three bytes are from char where 3 bytes are wasted
in memory space.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Are the variables argc and argv are always local to main?
What is a stream in c programming?
What is selection sort in c?
What is wrong with this program statement? void = 10;
what is the function of pragma directive in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
Is it possible to initialize a variable at the time it was declared?
Explain can you assign a different address to an array tag?
How can I do serial ("comm") port I/O?
Explain modulus operator.
What is the easiest sorting method to use?
Is fortran faster than c?
Write a program to check whether a number is prime or not using c?
What does double pointer mean in c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above