SHARE
TWEET

Untitled

a guest Aug 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top