in Education by
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! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
r is a pointer to `struct A, which contains a (non-pointer) member B (supposedly rect?) to a CvRect. So you have to write r->rect.width

Related questions

0 votes
    Is there a side effect in doing this: C code: struct foo { int k; }; int ret_foo(const struct ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    During a long compilation with Visual Studio 2005 (version 8.0.50727.762), I sometimes get the following ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    During a long compilation with Visual Studio 2005 (version 8.0.50727.762), I sometimes get the following ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    I have a JSON File with database environment configuration called env-config.json like this: { "LATEST":{ ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 10 years ago. Possible Duplicate: GNU C++ how to check ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Closed 10 years ago. Possible Duplicate: GNU C++ how to check ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    ________ function is usually used inside another function and throws a warning whenever a particular package is not ... R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I have a bunch of vector classes. I have a 2D point vec2_t, a 3D point vec3_t and a 4D point ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Consider following piece of code void foo( bool forwad ) { vector::iterator it, end_it; int dir; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Consider following piece of code void foo( bool forwad ) { vector::iterator it, end_it; int dir; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    I have a bunch of vector classes. I have a 2D point vec2_t, a 3D point vec3_t and a 4D point ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have an issue with passing a struct definition to a function. Not an instance of a struct, but the definition. We ... (object sender, EventArgs e) { GetHeaders( MineStruct ); //...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I'm trying to make a function in c to create and return a new struct similar to a constructor in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Can a local variable's memory be accessed outside its scope? (20 ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I have a linked list struct, i want to pass one node (another struct) pointer to a function (the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
...