Represent a dynamic matrix in one contiguous block

Read rows and cols in 1..20, allocate one contiguous block of ints and read values in -1000..1000. Print each zero-based row sum as row r: sum. Derive the index formula rather than memorizing it. Guard both rows * cols and the multiplication by element size before allocation. Check conversion/allocation failures and free on every post-allocation exit. Draw the flat indices for a 2 by 3 matrix. Explain why this int * is not an int **.


