Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

can we initialize all the members of union?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is strcpy() function?

1174


Explain bit masking in c?

1145


What does the file stdio.h contain?

1074


Explain what is dynamic data structure?

1175


What is volatile c?

1026


What is time null in c?

1082


Is printf a keyword?

1210


What is unary operator?

1111


How would you obtain the current time and difference between two times?

1298


What is a substring in c?

1042


explain what is fifo?

1090


provide an example of the Group by clause, when would you use this clause

2201


When can a far pointer be used?

1036


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

2384


Write a program to swap two numbers without using third variable in c?

1141