User Tools

Site Tools


ddsf:public:guidebook:06_append:glossary:u:union

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
ddsf:public:guidebook:06_append:glossary:u:union [2021/07/14 15:55]
murphy ↷ Page moved from ddsf:private:guidebook:06_append:glossary:u:union to ddsf:public:guidebook:06_append:glossary:u:union
ddsf:public:guidebook:06_append:glossary:u:union [2021/07/14 16:45] (current)
murphy ↷ Links adapted because of a move operation
Line 1: Line 1:
 ===== Union ===== ===== Union =====
-[[ddsf:private:​guidebook:​06_append:​glossary:​start| Return to Glossary ]]+[[ddsf:public:​guidebook:​06_append:​glossary:​start| Return to Glossary ]]
  
 A **Union** is like a data structure in that it generally has several fields, all of which are public by default. Unlike a struct, however, only one of the fields is used at any given time. In other words, it is a structure that allows the same storage space to be used to store values of different data types at different times. Thus it is necessary, and the programmer'​s responsibility,​ to keep track of what is actually stored in the union at any given time. A **Union** is like a data structure in that it generally has several fields, all of which are public by default. Unlike a struct, however, only one of the fields is used at any given time. In other words, it is a structure that allows the same storage space to be used to store values of different data types at different times. Thus it is necessary, and the programmer'​s responsibility,​ to keep track of what is actually stored in the union at any given time.
ddsf/public/guidebook/06_append/glossary/u/union.1626292554.txt.gz · Last modified: 2021/07/14 15:55 by murphy