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?



struct abc { unsigned int a; char b; float r; }; struct xyz { int u; struct abc tt; }ww;..

Answer / 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

More C Interview Questions

Differentiate between new and malloc(), delete and free() ?

0 Answers   iNautix,


Write a program to swap two numbers without using third variable?

0 Answers  


how c source file in converted to exe file

5 Answers   KPIT,


What is meant by int main ()?

0 Answers  


Is there any restriction in how many arguments printf or scanf function can take? in which file in my c++ compiler i can see the code for implementation of these two functions??

4 Answers  






which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

0 Answers  


how to print "hai" in c?

13 Answers   TCS,


what do the 'c' and 'v' in argc and argv stand for?

0 Answers   TISL,


is c language is a object oreinted language?

5 Answers   TCS,


What is the value of h?

0 Answers  


How to declare pointer variables?

0 Answers  


What is a pointer and how it is initialized?

0 Answers  


Categories