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
How can a number be converted to a string?
Compare array data type to pointer data type
What kind of structure is a house?
Is c high or low level?
Are there constructors in c?
What is character set?
What are c preprocessors?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
Is it fine to write void main () or main () in c?
Is main an identifier in c?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is the general form of function in c?
What are the benefits of organizational structure?
Can an array be an Ivalue?