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.

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));
				}
			}
		}
};
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.