Skip to content
Snippets Groups Projects
Select Git revision
  • 4ff440eaac9aee21bd0a6c7f5ce7927ee4cd9b94
  • master default
2 results

test-5.c

Blame
  • Forked from Peter Gerwinski / hp
    Source project has a limited visibility.
    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;
    }