The author is using one method (not the only) in C of creating two-dimensional array of doubles, namely, creating Y one-dimensional arrays of double, and a single array of X pointers to these. Each of those Y arrays is accessed by a variable of type . Then he creates a single one-dimensional array of pointers to each of these arrays, and stores those pointers in an array of type , or pointer-to-pointer-to-double.
There are several advantages of using this method to make 2D arrays. One, you need to do less math to reach an element, and you can even pass such arrays to functions that don't have to know their exact dimensions to work. Also, you can create things like triangular arrays, or other shapes where the sub-arrays need not all be the same size.
The only downside is that they take up a bit more memory.
answered Feb 10 '15 at 22:23
11.5k11 gold badge2121 silver badges4343 bronze badges
- What screams Im Indonesian
- What is dissolved oxygen
- What unanswered questions nag at you
- Are you an exhibitionist
- How are the decorative arts categorized
- Who are cabinet rank ministers in telanagana
- Are fruits and vegetables carbohydrates
- How do successful people acquire good habits
- How do you find the Rocky films
- Which has more scope geology or geophysics
- Which is better Ajmer or Jodhpur
- Whats wrong with Kyrie Irving
- How do I automate my factory
- Should we trust William Barr
- Which Kitchen outlets do NOT need GFCI
- What kind of person is your type?no_redirect=1
- Do scorpions climb walls