Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4

Answer Posted / jack

I assume above code to be correctly written as below:
struct s
{
int a;
long b;
}
Union u
{int a;
long b;
}
sizeof(s)= 8
sizeof(u) = 4

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a shell structure examples?

596


Why c is procedure oriented?

576


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

817


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

636


What are the advantages of using linked list for tree construction?

647






What is a pragma?

672


What is your stream meaning?

610


How can a string be converted to a number?

521


In C language what is a 'dangling pointer'?

644


List some basic data types in c?

561


Why is c fast?

612


What is the meaning of typedef struct in c?

600


Which is better between malloc and calloc?

673


What does volatile do?

569


Was 2000 a leap year?

635