0

i read in (Learning OpenCV) topic about array of point and i dont understand difference between a multidimensional array (or matrix) of multidimensional objects and an array of one higher dimension that contains only one-dimensional objects.

3
  • If you could provide an example type for the two cases, I may understand your question. Commented Aug 7, 2013 at 1:50
  • Check out this link: stackoverflow.com/questions/1242705/… I hope this is what you want. Commented Aug 7, 2013 at 1:54
  • give me example pleace Commented Aug 7, 2013 at 2:04

1 Answer 1

0

In C and C++, a multidimensional array is simply an array of arrays.

On the other hand, there are a lot of data structures that emulate multidimensional arrays using pointers to rows or pointers to elements. Depending on how the data structure is defined, you can use the same arr[x][y] syntax to access the elements. Array indexing is defined in terms of pointer arithmetic, and in the common case where the prefix is the name of an array object, the name is implicitly converted to a pointer; if the prefix is already a pointer no conversion is done.

Recommended reading: Section 6 of the comp.lang.c FAQ.

(In C++, it's generally easier to use container classes rather than C-style arrays.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.