the arrays size grows a lot.
(pt1.x/y are points i am using via opencv)
the larger picture ie the outside "()" represent an object
the second set of "()" represent the iterations
and the individual elements of the iterations (the points) are points
if you help me i will love you forever
EDIT: the array increases by each of the above (marked with "")
Last edited by breakerbyte; April 9th, 2009 at 01:49 PM.
Do a breakdown of it. You say that "pt1.x/y are points i am using via opencv". What do you mean by "the second set of "()" represent the iterations"? Perhaps you want to create a class here, and then objects of this class would then be members of another class, and then the dynamic array would contain objects of this second class?
Also, you should state how does Lindley's example not work.
Changing everything to CvRect.
need foo to grow 5 rows and 1 column on demand. thats the real issue
It's easier if you use typedef.
typedef std::vector<CvRect> CvRectArray;
typedef std::vector<CvRectArray> CvRectArray2D;
// Assuming that CVRect is default constructible.
CVRectArray2D foo(5, CVRectArray(10)); A 5x10 array of CVRect
// resize to 10x20
// first, resize the existing rows
for (CVRectArray2D::size_type i = 0; i < foo.size(); ++i )
// now add on new rows