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
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
If null and 0 are equivalent as null pointer constants, which should I use?
Why do we need functions in c?
difference between native and cross compilers
How can you tell whether two strings are the same?
Does free set pointer to null?
How can I invoke another program or command and trap its output?
What is the difference between test design and test case design?
I need a sort of an approximate strcmp routine?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
what is the significance of static storage class specifier?
How can I insert or delete a line (or record) in the middle of a file?
What is meant by operator precedence?
Explain high-order bytes.
Why we not create function inside function.