void displayPrice(double money[])
{
for(int i = 0; i < 5; i++)//I am making the array 5 elements
{
//using this as an example for a similar problem
//
}
cout<<monkey[i]<<endl;//something like this. Can that be done?
//to print everything the array
}
I know the syntax is not accurate and I'm missing some code.
I think I got it everyone. May not be the best looking piece of code, but its working. I hope I don't get a lot of point deductions. I really appreciate everyone's help. I would love to pick everyone's brain and learn more. If anyone is interested.
you basically advance a temporary pointer through the data, one location at a time, rather than index a base pointer + offset (which is what[] notation does for you).
Range based for loops and many stl tools work off this base concept. I used a c-string because it has an easy stop condition, but you can do it on any array/vector.
When passing a regular array to a function it is recommended you also pass the array's size. The number of elements. Hard-coding that information limits the reusability of your function.
void printArray(int arr[], int arrSize) not void printArray(int arr[])
Thanks for the info everyone. I don't due a whole lot these days. Feel free to add me on snapchat or whatever. stay-strong365. Not a whole lot of adults to talk to lol.