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

Is malloc memset faster than calloc?

0 Answers  


What should not contain a header file?

2 Answers  


How can I set an array's size at run time?

9 Answers  


program to find the roots of a quardratic equation

1 Answers  


Is fortran still used today?

0 Answers  






wt is d full form of c

6 Answers   TCS, Wipro,


Can main () be called recursively?

0 Answers  


main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0; } a)0 1 6 2 b)0 1 6 7 c)Compilation error d)None of the above

6 Answers  


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

0 Answers   Wilco,


what is the c.

3 Answers   IBM, TCS,


what is a stack

3 Answers  


main() { printf("hello%d",print("QUARK test?")); }

5 Answers  


Categories