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

Size fo strucure wil be the total bytes of the datatypes
inside it..
so,4+4=8;
For unions the size wi be the size of the datatype whose
memory is high,.
so,its 4,.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are c header files?

581


Do character constants represent numerical values?

844


What does dm mean sexually?

811


What are 'near' and 'far' pointers?

620


Is c weakly typed?

578






How the c program is executed?

632


Can a program have two main functions?

572


Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.

2649


explain what is a newline escape sequence?

690


How is = symbol different from == symbol in c programming?

614


What is the role of this pointer?

549


about c language

1602


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

613


Explain what are the __date__ and __time__ preprocessor commands?

594


What is the significance of c program algorithms?

682