I'll bump it again. Two questions -

Why are the calls above to malloc instead of calloc if we are making arrays? Or, does malloc return contiguous memory? My understanding is C relies on arrays being held in one chunk in memory so it can quickly jump to any index knowing only the start address and size of each element. Will malloc mess this up?

Second - when something like "unsigned char Image[1000][1000]" is defined, is the memory in one contiguous block? Essentially, does the compiler implement it as an array of size 1000*1000, or as above (an array of pointers to arrays)? I'm wondering if allocating the data structure as above sacrificies some efficiency referencing indicies. Is it slower to pull an element out of the Image array above then one defined like "unsigned char Image[1000][1000]"?