Create a loop to accept(input) the user’s responses and store them in the
arrays
you had a perfect example of this:
1 2 3 4 5
|
for (int i = 0; i < people; i++)
{
cout << "Enter each sales person's name: " << endl;
cin >> names[i];
}
| |
pointers .. you can use the [index] syntax from arrays just like above is fine.
----------------
Declare a string pointer to be used to point to the array of salesperson names.
also in good shape. you did this: is line 25 above.
-----------------------
Declare an int pointer to be used to point to the array of salesperson sales.
your turn. its just like the string pointer, you need to use the 'new' statement.
and every new requires a delete -- for now put these at the end of main before you return 0 and call it good enough.
find an online resource if you don't get new and delete.
the 2 cent version.. these keywords ask the OS for permission to use a section of ram (new!), and when done with it, tell the OS to take it back so some other program can use it (delete!).
pointers can be a little funky, but think of them as an array index into the giant array we call 'ram' and that may help you to make sense of it.