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 |
Which is an example of a structural homology?
What is boolean in c?
Write a C program to fill a rectangle using window scrolling
second highest number in a given set of numbers
What is a macro in c preprocessor?
If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5).
5 Answers Microsoft, Motorola,
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
What is f'n in math?
Are there constructors in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed
What are the rules for the identifier?