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

Process by which one bit pattern in to another by bit wise operation is?

0 Answers   InterGraph,

what is the use of c program?

4 Answers   Synergy, Web Synergies,

Three major criteria of scheduling.

1 Answers  

How to swap two values using a single variable ? condition: Not to use Array and Pointer ?

6 Answers  

Explain what does the function toupper() do?

0 Answers  

Write the following function in C. stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return - 1. The function should not make use of any C library function calls.

3 Answers   Infosys, Google, JTL, OpenFeel,

What is the purpose of main() function?

0 Answers  

char *p="name"; printf(p);

1 Answers  

Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

0 Answers   MNC,

#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers  

what is the different between if-else and switch statment (other than syntax)

26 Answers   Oracle, CTS, Scorpos,

What are type modifiers in c?

0 Answers