I would think that you don't want an arry of pointers to char but an arry of chars
like this
Code:
unsigned char colorBuffer[300 * 400 * 3];
unsigned int r = 0, g = 0, b = 0;
// GetR,G,B returns an int between 0 and 255
r = currentMaterial.getR();
g = currentMaterial.getG();
b = currentMaterial.getB();
colorBuffer[arrayTracer + 0] = r;
colorBuffer[arrayTracer + 1] = g;
colorBuffer[arrayTracer + 2] = b;
Kurt
edit: If you really want it to be an arry of pointers to char you would have to allocate space for the chars but that is most unusual ( and a wast of space ).
like this
Code:
unsigned char * colorBuffer[300 * 400 * 3];
unsigned int r = 0, g = 0, b = 0;
int i;
for ( i = 0; i < 300 * 400 * 3; ++i )
colorBuffer[i] = malloc(1);
// GetR,G,B returns an int between 0 and 255
r = currentMaterial.getR();
g = currentMaterial.getG();
b = currentMaterial.getB();
* colorBuffer[arrayTracer + 0] = r;
* colorBuffer[arrayTracer + 1] = g;
* colorBuffer[arrayTracer + 2] = b;