struct abc
{

unsigned int a;
char b;
float r;
};
struct xyz
{
int u;
struct abc tt;
}ww;
ww = (struct xyz*)malloc(sizeof(struct xyz));
will the memory be allocated for the inner structure also?

Answer Posted / sadanand

Yes. when sizeof(xyz) is done. it will compute size of
struct abc + size of int

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

684


swap 2 numbers without using third variable?

656


What are the 5 organizational structures?

567


Can you tell me how to check whether a linked list is circular?

764


What are the types of pointers?

596






Why is c called c not d or e?

604


Disadvantages of C language.

651


Do you know the difference between malloc() and calloc() function?

608


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

741


Write a program which returns the first non repetitive character in the string?

597


Are the variables argc and argv are always local to main?

569


What is malloc and calloc?

571


Is fortran faster than c?

572


how could explain about job profile

1446


In C, What is the #line used for?

1047