I've been working on resize.c and after a long time of hard work. I completed it but I wasn't able to understand that
Whenever I use
fwrite(&triple, sizeof(RGBTriple), atoiargv[1], outptr);
The output file becomes unsupported but whenever I use
for(int l=0;l<atoi(argv[1]);l++)
{
// write RGB triple to outfile while doing horizontal resizing
fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
}
It works!!
But in the man page of fwrite() it is defined as
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
where nmemb represents the number of data elements we need to write Please enlighten me on this !!
[EDIT: code not needed to answer question, removed for Honor Code compliance.]