Skip to content
Snippets Groups Projects
Select Git revision
  • 9e089bf026ec17030f58f10e78a7187093fba479
  • master default protected
  • 2018ws
  • 2017ws
  • 2016ws
5 results

objects-1.c

Blame
  • Forked from Peter Gerwinski / hp
    260 commits behind the upstream repository.
    objects-1.c 310 B
    #include <stdio.h>
    
    typedef struct
    {
      int type;
    } t_base;
    
    typedef struct
    {
      int type;
      int content;
    } t_integer;
    
    typedef struct
    {
      int type;
      char *content;
    } t_string;
    
    int main (void)
    {
      t_integer i = { 1, 42 };
      t_string s = { 2, "Hello, world!" };
    
      t_base *object[] = { &i, &s };
    
      return 0;
    }