Skip to content
Snippets Groups Projects
Select Git revision
  • f82db55e55a29f63e5d3395a97c7dc0a7811c143
  • 2025ss default
  • 2024ss
  • 2023ws
  • 2022ws
  • 2021ws
  • 2020ws
  • 2019ws
  • 2019ss
  • 2018ws
  • 2017ws
  • 2017ss
  • 2016ws
  • 2016ss
  • 2015ss
15 results

loesung-1.2-02.c

Blame
  • show-pbm-1.c 285 B
    #include <stdio.h>
    
    int main (void)
    {
      FILE *f = fopen ("test.pbm", "r");
      char id[42];
      int width, height;
      fscanf (f, "%s", id);  // should be "P4"
      printf ("%s\n", id);
      fscanf (f, "%d", &width);
      fscanf (f, "%d", &height);
      printf ("%d %d\n", width, height);
      return 0;
    }