Matrices with Full Storage

Functions dealing with matrices

Complete the following code snippet such that:

#include <stddef.h>
#include <stdio.h>

void
initMatrix(size_t m, size_t n,
           double *A,
           ptrdiff_t incRow, ptrdiff_t incCol)
{
    // your code here
}

// your code for function printMatrix here


#define MAX_ROWS    100
#define MAX_COLS    100

double A[MAX_ROWS*MAX_COLS];

int main()
{
    size_t m = 5;
    size_t n = 8;

    size_t incRow = n;
    size_t incCol = 1;


    initMatrix(m, n, A, incRow, incCol);
    printMatrix(m, n, A, incRow, incCol);

    // make additions here:

    return 0;
}

Using Functions

Make additions to function main (and only main) such that: