#include<iostream.h> #include<conio.h> union address { char *name; char street[10]; int pin; }; void main() { union address emp, *p; emp.name="ja\0pan"; p=&emp; cout<<p->name; cout<<(*p).name; getch(); } Output: jaja
About Dinesh Thakur
Dinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.
For any type of query or something that you think is missing, please feel free to Contact us.