Advertisement
Guest User

header read draft

a guest
Oct 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. FILE *fp = fopen("feep.pgm", "r");
  2. int ch = getc(fp);
  3. // int i;
  4. int header [3];
  5.  
  6.  
  7. // Pnm_ppm myImage;
  8. // NEW(myImage);
  9. // myImage->width = 10;
  10. // (*myImage).width = 10;
  11.  
  12. while (!feof(fp)) {
  13. putchar(ch);
  14.  
  15. ch = getc(fp);
  16. fscanf (fp, "%d", header);
  17. printf("\nHeader Values: %d, %d, %d\n", header[0], header[1], header[2]);
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement