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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
what are the 10 different models of writing an addition program in C language?
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]
program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5
Explain union.
Is swift based on c?
Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + +
Write the Program to reverse a string using pointers.
Do you know null pointer?
What is static and auto variables in c?
What is structure in c language?
What header files do I need in order to define the standard library functions I use?
what is mean by Garbage collection ? Please answer me. Advance thanks.