2D array of CRect

Posted on 2008-10-21
Last Modified: 2013-11-20

Can anybody tell me how to create a two dimensional array of CRect objects in an MFC application?

Question by:IssacJones
1 Comment

Accepted Solution

tg_wilk earned 250 total points
Comment Utility
the normal way?

CRect MyArray [5][5]; //5x5 array

//and you can access the elements like this;

for (int i=0; i<5; i++)


   for (int j=0; j<5; j++)


      CRect rectangle = MyArray[i][j];



Open in new window


Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
substring method in java 1 79
haveThree challenge 22 100
tripleUp challenge 7 65
ShiftLeft challenge 21 65
If you haven’t already, I encourage you to read the first article ( in my series to gain a basic foundation of R and R Studio.  You will also find the …
This article will show, step by step, how to integrate R code into a R Sweave document
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now