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 / reachhary
As already told by vrushali memory to a structure is always
allocated along word boundaries. So int would fetch 4 bytes
(assumed that the int in ur machine takes 4 and word is 4
bytes). Similarly char would take 1 but since the next entry
i.e. float requires 4 so char would be given 4 (3 extra )
and so on for the remaining summing upto 60 as already
indicated.
By default temp would have the base address of the structure
i.e. pointing to the first integer i.e. 'a' in our case.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What is pointers in c?
In C programming, what command or code can be used to determine if a number of odd or even?
Can you please explain the difference between malloc() and calloc() function?
What is a floating point in c?
What is c language in simple words?
What is calloc in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What are the key features in c programming language?
What is extern keyword in c?
Why void main is used in c?
Explain what is meant by 'bit masking'?
Write a program to identify if a given binary tree is balanced or not.
What is huge pointer in c?
When c language was developed?