Okay so I'm trying to read in a PPM file (p3 format) and I want to read the comments (which are #s in ppm files).
The problem is that I don't know how to make C do what is in my head, heres what I want it to do.
read the file
where # appears, store all characters until the %\n character appears
repeat until all comments are read
I understand that I should be using some variations of getc, fgets and fscanf but I don't know how to apply them in this context.
I would put some code up showing what i've tried with getc, fgets and fscanf but to be brutally honest I have no idea how to use any of those functions and none of the info I can find seems to help and I really don't think any of my implementations are even doing anything.
Does anyone /is anyone willing to show me an example of how to parse a line with any of these functions?