summaryrefslogtreecommitdiff
path: root/01-24.md
diff options
context:
space:
mode:
authorloshprung <lshprung@scu.edu>2020-01-29 11:31:57 -0800
committerloshprung <lshprung@scu.edu>2020-01-29 11:31:57 -0800
commitbf8af6c4697cf380445bc028109200d3a4cf288c (patch)
treef571a24291a33795c97b6cbdf2c9f450268b1b97 /01-24.md
parent7f939ea40a4451ab1320ac508d2922fc3b20ac19 (diff)
Post-class 01/29
Diffstat (limited to '01-24.md')
-rw-r--r--01-24.md12
1 files changed, 8 insertions, 4 deletions
diff --git a/01-24.md b/01-24.md
index 67a9792..2f98b10 100644
--- a/01-24.md
+++ b/01-24.md
@@ -22,7 +22,7 @@ union union_t{
Alternatively, you can use `typedef`:
```
-typedef union{
+typedef union union_t{
variable declaration;
variable declaration;
...
@@ -34,7 +34,7 @@ Both examples above are type definitions and do not allocate memory
Union Example:
```
-typedef union{
+typedef union art_info{
int age;
char artist[20];
} ART_INFO;
@@ -81,12 +81,12 @@ info_array[0].age = 1000;
- Union example in a Structure:
```
-typedef union{
+typedef union art_info{
int age;
char artist[20];
} ART_INFO;
-typedef struct{
+typedef struct art_class{
char name[20];
int class;
ART_INFO info;
@@ -100,3 +100,7 @@ ART_CLASS class_array[4] =
```
- Be careful not to reference an invalid member in your union!
+
+---
+
+[-> Notes 01/29](01-29.md)