Re: Understanding Dynamic Multidimensional Arrays

Ahh, but I see that your professor has given you predefined function names... Does that mean that he also predefined the parameters as well?

DevonZ, on 05 August 2012 - 08:00 AM, said:

However, my professor still makes us structure our programs with pre-defined function names that he's made up and the main goal of this assignment is to gain experience with multidimensional arrays. Hopefully though, as things progress, we're given more flexibility.

If you are stuck with the function name and parameters, then you'll have 2 options:
Option 1: Stick a copy of the pixMap pointer into a global. Yuck!
Option 2: Do the allocation for pixMap in main() prior to passing to drawRectangle() and writeToPPM().