Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. union Value {
  2. char* s;
  3. int i;
  4. };
  5. enum Type {str, num};
  6. struct Entry {
  7. char* name;
  8. Type type;
  9. Value val;
  10. };
  11. ...
  12. void EntryHandler(Entry& ent) {
  13. if(ent.type == str) {
  14. std::cout << ent.val.s;
  15. }
  16. ...
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement