Question: Use the following code snippet as the basis for a program to test all possible combinations of pointer manipulation. Each of the 10 combinations must
Use the following code snippet as the basis for a program to test all possible combinations of pointer manipulation. Each of the 10 combinations must be tested separately since the pointer may move and array values may be changed:int X[] = { 3, 7, 11, 17, 23 };int * xPtr = & X[2];cout << X[1] << ' ' << X[2] << ' ' << X[3] << ' ' << xPtr << " : " << *xPtr << endl;cout << "Array content prior to pointer manipulation ";// replace AAA in the following statement with selection from list of 10 pointer actions below, one at a timecout << AAA << endl;cout << endl << "Array content after ptr manipulation" << endl;cout << X[1] << ' ' << X[2] << ' ' << X[3] << ' ' << xPtr << " : " << *xPtr << endl;Generate an extremely concise summary report explaining the result of each of these pointer actions when inserted in place of AAA above. The report must identify: were any array values changed and, if the pointer moved, where and when it moved, and what value was output. The summary should group together any commands that produce identical results. The summary must be less than 100 words.*xPtr++(*xPtr)++*(xPtr)++*(xPtr++)*(++xPtr)*++xPtr(*++)xPtr++*xPtr++ (*xPtr)(++*)xPtr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
