The following expression can be used to access an element of the array.
*(a + i * cols + j)
1. "a" points to the 0th element of the list; this is a constant.Array elements are stored in consecutive linear memory locations. We can use pointer arithmetic to access these elements. The expression a + i * cols + j provides the offset into memory from the beginning of the list.