This is not a graded question so please don't disregard it as if it is.Thank you in advance professor!Note: This is a THEORETICAL QUESTION and no code should be used for solving it. =NR || j...

This is not a graded question so please don't disregard it as if it is.Thank you in advance professor! Note: This is a THEORETICAL QUESTION and no code should be used for solving it.You are given the following function moveIndexes, where NR and NC are numerical constants. The function receives as<br>parameters rp and cp, two pointers to int. The goal of the function is to modify the values pointed by rp and cp as follows: if<br>rp and cp originally point to the indexes of a certain cell of the matrix, after function invocation they must point to the indexes of<br>a cell at a distance delta from the original one.<br>int moveIndexes (int M[NR] [NC], int *rp, int *cp, int delta) {<br>int i, j, =NR || j<0 |[="" j="">=NC) return 1; // error - nothing done p0 = & (M[0] [0]); p = & (M[i]][j]); p= p+delta; if (p < p0="" ||="" p=""> & (M[NR-1] [NC-1])) return 1; // error - nothing done *rp = (p - p0) / NC; *cp = (p - p0) % NC; return 0; Assume that NR and NC are equal to 10, that addresses are represented with 32 bits, and that sizeof (int) is equal to 4. Answer the following questions: A) delta represents an increase or a decrease: of what? (Explain your answer) 1. of row? 2. of column? B) Given *rp%3D3 and *cp=D4, delta=12, which values will be assigned to rp and ep at the end of function execution? (Justify your answer or show intermediate results) 3. other (what?) "/>
Extracted text: You are given the following function moveIndexes, where NR and NC are numerical constants. The function receives as parameters rp and cp, two pointers to int. The goal of the function is to modify the values pointed by rp and cp as follows: if rp and cp originally point to the indexes of a certain cell of the matrix, after function invocation they must point to the indexes of a cell at a distance delta from the original one. int moveIndexes (int M[NR] [NC], int *rp, int *cp, int delta) { int i, j, "p, *p0; i = *rp; j = *cp; if (i<0 |1="" i="">=NR || j<0 |[="" j="">=NC) return 1; // error - nothing done p0 = & (M[0] [0]); p = & (M[i]][j]); p= p+delta; if (p < p0="" ||="" p=""> & (M[NR-1] [NC-1])) return 1; // error - nothing done *rp = (p - p0) / NC; *cp = (p - p0) % NC; return 0; Assume that NR and NC are equal to 10, that addresses are represented with 32 bits, and that sizeof (int) is equal to 4. Answer the following questions: A) delta represents an increase or a decrease: of what? (Explain your answer) 1. of row? 2. of column? B) Given *rp%3D3 and *cp=D4, delta=12, which values will be assigned to rp and ep at the end of function execution? (Justify your answer or show intermediate results) 3. other (what?)
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here