What is an anonymous union and where to apply that ?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; }
Write a program to print “hello world” without using semicolon?
write a program in reverse the string without using pointer,array,global variable declaration,lib fun only using a function?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
where does malloc() function get the memory?
What is the use of structure padding in c?
What is the difference b/w Structure & Class?
is it possible to change the default calling convention in c ?
how do we remove the printed character in printf statement and write next it it
What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }