I have a struct A that is defined as follows:
typedef struct A
{
CvRect B; // rect
int C;
double D;
}
A;
…
In my main program, I grab one item of a sequence of items:
A *r = (A*) cvGetSeqElem(X, i);
Whenever I try to access rect, I get one of the following errors:
if (r.rect.width>100 && r.rect.height>100)
error: request for member ‘rect’ in ‘r’, which is of non-class type ‘A’
or
if (r->rect->width>100 && r->rect->height>100)
error: base operand of ‘->’ has non-pointer type ‘CvRect’
Any idea how to access the struct CvRect->height if it is inside another struct?
Thanks!
ris a pointer to`struct A, which contains a (non-pointer) memberB(supposedlyrect?) to aCvRect. So you have to writer->rect.width