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 the different types of linkage exist in c?

615


Tell me the use of bit field in c language?

634


All technical questions

1514


4. main() { int c=- -2; printf("c=%d",c); }

1373


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

728






Do you know what are bitwise shift operators in c programming?

589


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2339


Why does notstrcat(string, "!");Work?

646


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

637


Define Spanning-Tree Protocol (STP)

649


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2706


How can I find out the size of a file, prior to reading it in?

628


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

680


What does the characters “r” and “w” mean when writing programs that will make use of files?

862


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

644