union and typedef
Title
Question
difference between union and typedef
Advance-C Union-and-Typedef 04-05 min 20-30 sec
Answers:
Hello
To understand the difference between typedef and union, pls go through the spoken tutorial
"Union and Typedef" under the "Advance C" course on our website.
http://spoken-tutorial.org/tutorial-search/?search_foss=Advance+C&search_language=English
To understand the difference between typedef and union, pls go through the spoken tutorial
"Union and Typedef" under the "Advance C" course on our website.
http://spoken-tutorial.org/tutorial-search/?search_foss=Advance+C&search_language=English
<span style="color: rgb(60, 64, 67); font-family: Roboto, HelveticaNeue, Arial, sans-serif; font-size: 18px;">The only </span>difference between<span style="color: rgb(60, 64, 67); font-family: Roboto, HelveticaNeue, Arial, sans-serif; font-size: 18px;"> them is memory allocation. Structure allocates storage space for all its members separately; Whereas, </span>Union<span style="color: rgb(60, 64, 67); font-family: Roboto, HelveticaNeue, Arial, sans-serif; font-size: 18px;"> allocates one common storage space for all its members. Members of a </span>union<span style="color: rgb(60, 64, 67); font-family: Roboto, HelveticaNeue, Arial, sans-serif; font-size: 18px;"> can only be accessed one at a time. The </span>union<span style="color: rgb(60, 64, 67); font-family: Roboto, HelveticaNeue, Arial, sans-serif; font-size: 18px;"> data type was invented to prevent memory fragmentation.</span>
<span style="color: rgb(51, 51, 51); font-family: "Droid Sans"; font-size: 13px;">The keyword Typedef is used to give a new symbolic name for the existing name. </span>
<span style="color: rgb(51, 51, 51); font-family: "Droid Sans"; font-size: 13px;">Typedef is type definitions make code more readable by giving application-specific names to types. </span>
<font color="#333333" face="Droid Sans"><span style="font-size: 13px;">
</span></font>
</span></font>
<span style="padding: 0px; margin: 0px; outline: none; list-style: none; border: 0px none; color: rgb(0, 0, 0); font-family: "Droid Sans"; font-size: 13px;">Union allocates one common storage space for all its members. </span>
Login to add comment