sallubhai 0 Newbie Poster

Hi, I want to draw some rectangles with the same size and different colors by using an array but don´t know exactly how to do it in the for-loop.
Thanks for help!

class Figure
{
	private:
		int **figur;
		int row,col;
	public:
		Figure()
			: row(5), col(20){
		}
		void allocate_place(int r, int c)
		{
			this->figur = new int *[r];
			for (int i=0; i < r; i++)
				this->figur [i] = new int [c];
			this->row = r;
			this->col = c;
		}

		void drawing_figure(BITMAP *buffer)
		{
			for (int i=0; i < this->row; i++)
			{
				for (int j=0; j < this->col; j++)
				{					
					//rectfill(buffer, fig1x, fig1y, fig1x+30, fig1y+30, makecol(0, 60, 50));
				}
			}
		}
};