programplug Logo




C Union


Like Structures, union is a user defined data type.Used For holding different type of elements.In Union all members share the same memory location. Use same memory for two ore more members union is useful.

union union_name   
{  
    data_type 1;  
    data_type 2;  
    .   
    data_type N;  
};    
union abc
{
   int x, y;
}; 
void main()
{
    union abc a;
    a.x = 2; 
    printf ("\n x = %d, y = %d\n\n",a.x, a.y);
    a.y = 10;
    printf ("\n x = %d, y = %d\n\n",a.x, a.y);
} 

Output
x = 2, y = 2
x = 10, y = 10






Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training
SCO,SMO

Contact Us

Dehradun Uttarakhand India
www.programplug.com
info@programplug.com
08534019974
Designed By : Mridul Gupta

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy