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.
Extracted text: C) Assume that the main contains the definition of the following variables and/or constants: int mat[NR][NC]; int i=0, j=0, "pi=&i, *pj=&j; Which of the following function calls contain errors? (Say why) 1. moveIndexes (mat, &i, &j, NC); 2. moveIndexes (mat, pi, pj, NR); 3. moveIndexes (mat, *pi, *pj, NR); 4. moveIndexes (mat, i, j, NC); B 三 A) delta represents an increase or a decrease: of what? (Explain your answer) 1. of row? (Justify your answer) 2. of column? (Justify your answer) 3. other (What? Justify your answer) B) Given *rp=3 and *cp=4, delta=12, which values will be assigned to *rp and *cp at the end of function execution? (Justify your answer or show intermediate results) *rp = *cp = C) Which of the following function calls contain errors? (Say why) 1. moveIndexes (mat, &i, Ej,NC); 2. moveIndexes (mat, pi,pj,NR); 3. moveIndexes (mat, pi, *pj,NR); 4. move Indexes (mat, i,j, NC) ;
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 movelndexes (int M[NR][NC], int *rp, int *cp, int delta) { int i, j, *p, *p0; i = *rp; j = *cp; if (i<0 ||="" i="">=NR || j<0 \[="" j="">=NC) return 1; // error nothing done p0 = & (M[] [0]); p = & (M[i [5]); 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? 3. other (what?) B) Given *rp3D3 and cp=4, delta=12, which values will be assigned to rp and cp at the end of function execution? (Justify your answer or show intermediate results) C) Assume that the main contains the definition of the following variables and/or constants int mat [NR] [NC];0>0>