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 the use of in c?

1086


Write a Program to accept different goods with the number, price and date of purchase and display them

6298


What is floating point constants?

1194


What is the sizeof () operator?

1136


What is meant by type casting?

1106


Why is c fast?

1122


List out few of the applications that make use of Multilinked Structures?

2260


Can the sizeof operator be used to tell the size of an array passed to a function?

1178


Is that possible to store 32768 in an int data type variable?

1139


What is C language ?

2020


what are bit fields? What is the use of bit fields in a structure declaration?

2205


What is structure packing in c?

1140


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

1178


What will be the outcome of the following conditional statement if the value of variable s is 10?

1373


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2353