Skip to content

Instantly share code, notes, and snippets.

@compiler-errors
Created May 2, 2019 03:34
Show Gist options
  • Select an option

  • Save compiler-errors/ce6d608499fa2661bf56318033499c93 to your computer and use it in GitHub Desktop.

Select an option

Save compiler-errors/ce6d608499fa2661bf56318033499c93 to your computer and use it in GitHub Desktop.
struct Value {
int reference; // Just a uniquely identifying value for this struct. Counts up from 0.
size_t data_size;
};
struct IntValue {
int reference;
size_t data_size; // Should always be sizeof(int) = 4.
int value;
};
struct StringValue {
int reference;
size_t data_size; // Variable, based on the size of data[] below.
char data[];
};
struct DoubleValue {
int reference;
size_t data_size; // Should always be sizeof(double) = 8.
double value;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment