Hi All,

I have a question about 1D arrays.

if I have an array structure like this:

ABCD
EFGH
IJKLM

and I want to create from that, this array:

AABBCCDD
AABBCCDD
EEFFGGHH
EEFFGGHH
IIJJKKLLMM

where the elements, row and columns are doubled?

How do I start? Here's what I did, and its wrong.

Code:
                
                numpix = height * width;

                unsigned char* pixdata = new unsigned char[numpix];

	 inFile.read((char *) pixdata, numpix);
     
	
	 for(int i = 0; i < numpix*2; i++)
	 {
	 cout << (unsigned int)pixdata[i] << endl;
	 cout << (unsigned int)pixdata[i] << endl;
	 }