The memory

What is the output of the following code? (8)

int *intArrayPtr;

int *temp;

intArrayPtr = new int[5];

*intArrayPtr = 7;

temp = intArrayPtr;

for (int i = 1; i < 5;=”” i++)=””>

    intArrayPtr++;

    *intArrayPtr = *(intArrayPtr – 1) 1 2 * i;

intArrayPtr = temp;

for (int i = 0; i < 5;=”” i++)=””>

    cout < *intarrayptr=””>< “=””>

    intArrayPtr++;

cout <>

Suppose that numPtr is a pointer of type int and gpaPtr is a pointer of type double. Further suppose that numPtr = 1050 and gpaPtr = 2000. Also suppose that the size of the memory allocated for an int value is 4 bytes and the size of the memory allocated for a double value is 8 bytes. What are the values of numPtr and gpaPtr after the statements numPtr = numPtr + 2; and gpaPtr = gpaPtr + 3; execute? (7)

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X