can we initialize all the members of union?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many header files are in c?

543


What is an auto keyword in c?

633


What is optimization in c?

561


What math functions are available for integers? For floating point?

614


What is the function of this pointer?

663






write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

1512


Why we not create function inside function.

1740


What are the benefits of c language?

638


number of times a digit is present in a number

1535


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1452


What is the significance of c program algorithms?

674


Explain the meaning of keyword 'extern' in a function declaration.

708


What is main return c?

507


What is the newline escape sequence?

576


I need a sort of an approximate strcmp routine?

650