What is an anonymous union and where to apply that ?

Answers were Sorted based on User's Feedback



What is an anonymous union and where to apply that ?..

Answer / swetcha

An anonymous union is a union without a name. It cannot be
followed by a declarator. An anonymous union is not a type;
it defines an unnamed object.

The member names of an anonymous union must be distinct
from other names within the scope in which the union is
declared. You can use member names directly in the union
scope without any additional member access syntax.

Is This Answer Correct ?    4 Yes 1 No

What is an anonymous union and where to apply that ?..

Answer / priya

Anonymous unions are unions that are declared without a class-name or declarator-list.

union { member-list }

Such union declarations do not declare types
but they declare objects
They must also be declared as static if
declared in file scope. If declared in local scope
they must be static or automatic.

Is This Answer Correct ?    3 Yes 0 No

What is an anonymous union and where to apply that ?..

Answer / monisha

anonymous union is a class name.it cannot be followed by
the declarator.it must be declared with the keyword
static.it cannot have protected and private members.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Without Computer networks, Computers will be half the use. Comment.

0 Answers  


Explain pointer. What are function pointers in C?

0 Answers   HCL,


what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above

3 Answers   Accenture, Infosys, Wipro,


a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=?

6 Answers   Geometric Software,


Explain the difference between the local variable and global variable in c?

0 Answers  






Why doesnt that code work?

0 Answers  


Why void is used in c?

0 Answers  


How can I implement a delay, or time a users response, with sub-second resolution?

0 Answers  


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

0 Answers  


How is null defined in c?

0 Answers  


wat is the difference between array and pointer?

4 Answers   Wipro,


what is the maximum limit of row and column of a matrix in c programming. in linux .

4 Answers   NIIT,


Categories