Created
July 22, 2018 17:32
-
-
Save Gydo194/25ee01364e9f1a99cab5b10790ad3cfd to your computer and use it in GitHub Desktop.
C Multi-Type struct implementation with run-time type information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//rtti_mt.h | |
//Run Time Type Information enabled Multi Type variable implementation | |
//Author: Gydo194 | |
//2207181714 | |
#pragma once | |
struct rtti_mt_t; | |
typedef struct rtti_mt_t rtti_mt_t; | |
struct rtti_mt_t | |
{ | |
enum | |
{ | |
INT, | |
DOUBLE, | |
CHAR, | |
STRING | |
} type; | |
union | |
{ | |
int int_value; | |
double double_value; | |
char char_value; | |
char *string_value; | |
} value; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment