More questions about PGMS

Mar 12, 2015 at 1:58am
I have an assignment and I am down to these two questions.


Assume myfile.pgm is a PGM file that opens successfully. What would cout << something below print?


ifstream fin("myfile.pgm");

string something;

fin >> something;

cout << something;



You just read the PGM file and found that the width is 20 and the height is 30. How many integers would you need to input to get all pixel data from the PGM file?
Mar 12, 2015 at 2:18am
What answers do you have? is #2 P2, #3 width, #4 white intensity... right? Idk about #1 either
I have the rest ;)
Mar 12, 2015 at 2:28am
I might have different questions then you

my number 1 is
Assume myfile.pgm is a PGM file that opens successfully. What would cout << something below print?


ifstream fin("myfile.pgm");

string something;

fin >> something;

cout << something;

number 2

After the P2, what is the next field?

number 3For PGM files and for CS102, what is the integer value for the color white?

number 4

You just read the PGM file and found that the width is 20 and the height is 30. How many integers would you need to input to get all pixel data from the PGM file?
Mar 12, 2015 at 3:47am
600 is answer
Topic archived. No new replies allowed.