can we initialize all the members of union?
Answers were Sorted based on User's Feedback
Answer / banavathvishnu
union
{
int a;
char ch;
float f;
}tt = {10};
main()
{
printf("%c",tt.ch);
}
In union it is enough to initialise one variable, same
value will reflect the value in remaning members also.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / vadivelt
Since Union follows the memory sharing concept, it is not
possible to initialise all union varibles at a time.
ie.,
union name
{
int a;
char b;
}c = {10, 'a'};
is not possible.
But it is possible to initialise one value at a time.
ie.,
union name
{
int a;
char b;
}c = {10};
or
union name
{
int a;
char b;
}c = {'a'};
| Is This Answer Correct ? | 0 Yes | 3 No |
Is sizeof a keyword in c?
what about "char *(*(*a[])())();"
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Can u please send me the exam pattern and also Previous papers to javed123go@gmail.com
Why c is a procedural language?
I need to take a sentence from input and sort the words alphabetically using the C programming language. Note: This is C not C++. qsort and strtok not allowed
Is a house a mass structure?
What will be the output of x++ + ++x?
to get a line of text and count the number of vowels in it
Explain how can you determine the size of an allocated portion of memory?
What does *p++ do? What does it point to?
How do you write a program which produces its own source code as output?