Advertisement
Runer112

Untitled

Apr 21st, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. typedef enum Type {
  2. A,
  3. B
  4. } type_t;
  5.  
  6. typedef struct A {
  7. ...
  8. } a_t;
  9.  
  10. typedef struct B {
  11. ...
  12. } b_t;
  13.  
  14. typedef struct Thing {
  15. type_t type;
  16. union
  17. {
  18. a_t a;
  19. b_t b;
  20. };
  21. } thing_t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement