I have been getting an error when trying to copy the header of a pgm to another. could someone please tell me where i'm wrong?
FILE *infile;
infile = fopen(fin, "rb");
fscanf(infile, "%s %d %d %d\n",&type,&u,&v,&depth);
FILE *outfile;
outfile = fopen(fout, "wb");
fprintf(outfile, "%s %d %d %d\n",&type,u,v,depth);