Skip to content
Snippets Groups Projects
Select Git revision
  • 6e8cd85f278c156f38cd717a12694ed08a689f2e
  • master default protected
2 results

readme.md

Blame
  • 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;
    }