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

gtk-06.c

Blame
  • Forked from Peter Gerwinski / hp
    Source project has a limited visibility.
    malloc-3.c 320 B
    #include <stdio.h>
    #include <stdlib.h>
    
    int main (void)
    {
      int *buffer = NULL;
    
      buffer = malloc (24 * sizeof (int));   /* 42 Integer-Variable anlegen */
                    /* ^^ Zahlendreher infolge Code-Verdopplung! */
    
      for (int i = 0; i < 42000; i++)
        buffer[i] = i;
    
      /* free() vergessen! :-( */
    
      return 0;
    }