Question: my question regrading to my homework for array and pointer and l did my research on YouTube to see l am if doing right or
my question regrading to my homework for array and pointer and l did my research on YouTube to see l am if doing right or wrong as the flow instruction:
Here are the main points that I want you to learn in this assignment: Understand the use of pointers and references. Study the example that I provide here. Demonstrate that you understand how to implement code with pointers. Copy/paste in the following code and compile it to verify that the IDE is working correctly. I have provided all of the code for this assignment

When you initially execute the code, just make sure it is working and free of errors. You should see the following output when you enter the identical inputs. Note that in this initial example, the output is undefined because the matrix addition is not in place.

The Problem In this assignment, I don't want you to change any functionality. All I want you to do is change the implementation of the loop from iterating through the array to the use of a single pointer. The output will remain the same. This is not trivial, so it may take some research and please read the daily readings that I provide. Here is a major hint. After the array is created, simply create a pointer variable called pNumbers and use that to print the values of the array. int number[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int *pNumbers = number; You will need to replace the code in red with the pointer. Don't use the array. cout
her what l did to replace the cout statement in the for loop with *pNumbers but what l do not understand is the last statement
Note that you will also have to do some simple pointer arithmetic to change the address of pNumbers. I will await your questions.
this the code that l did replace:
#include "stdafx.h"
#include #include using namespace std; int main() { cout
int number[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int size = sizeof(number) / sizeof(number[0]); for (int i = 0; i
int *pNumbers = &number[0]; cout
and this the console output:

there is something wrong that l don't understand
#include iostream #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
