Skip to content
Snippets Groups Projects
Select Git revision
  • 2022ss
  • 2024ss default
  • 2023ss
  • 2021ss protected
4 results

rtech-20220329-fig12.tex

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