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 will be the output off the following program? #include<stdio.h> int main() { int a; a=015+0*71+5; printf("%d,a"); return0; }
who is the editor of 'pokemon'?
Explain the use of fflush() function?
Explain what is meant by 'bit masking'?
What is the difference between union and anonymous union?
What is the difference between void main() and void main (void) give example programme?
How many parameters should a function have?
How many keywords are there in c?
how to find binary of number?
i need all types of question paper releted to "c" and other language.
Why do we need arrays in c?
char ch="{'H','I',0};printf("%s",ch);what is output