Hi I am reading data r b g from a ppm file how do I fill an

Hi I am reading data r b g from a ppm file- how do I fill an array with those values array = [width][height][3]

so say position 01 has a value 255 0 0

from the ppm file

how do I read/ load the 3 values into each of the positions in the array thanks using C++

Solution

Answer:

int height = 255;

int width = 0;

int ExNum = 0\';

int MYArray[3];

MyArray += height;

MyArray += width;

MyArray += ExNum;

this will store your value in MyArray like this MyArray[3] = [255,0,0];

Hi I am reading data r b g from a ppm file- how do I fill an array with those values array = [width][height][3] so say position 01 has a value 255 0 0 from the

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site