Explain each line of the the code d. [35 pts] Function addMat takes in 2 square
ID: 3731270 • Letter: E
Question
Explain each line of the the code
d. [35 pts] Function addMat takes in 2 square matrices (matA and matB) of size n x n. Complete the addMat function with the following specifications i. Allocate an n x n integer matrix and have it pointed by pointer matR. ii. Perform matrix addition: matR = matA + matB ii. Return resulting matirx at the end of function iv. Be aware of the data type declared in the function. v. You must not use any array annotation, such as [ 1, in this problem. Any use of array annotation will result in receiving 0 point. addMat ( int** matA, int** matB, int n) f int** matRi //Hint: A double pointer is a pointer to pointers int**Explanation / Answer
int **addMat(int **matA, int **matB, int n) { int **matR; int i, j; matR = (int **)malloc(sizeof(int *)*n); for(i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.