Alright, I'm trying to find the largest value through a set of numbers that the user enters. I've googled how to and looked through the forums but I don't understand why or the process of it.
Well you shouldn't use magic numbers like 10. You should assign it to a constant variable and use that through the program.
How do you iterate through the array? Using a for loop like ...
AbstractionAnon showed you how to do the for loop for entering the information. If you are referring to finding the largest value that is very simple. Just iterate over all the elements and check if it is larger than the previous largest.
1 2 3 4 5 6 7 8 9 10 11
std::string personWhoAteMost = person[0];
int largestAte = pancakes[0];
for(int i = 1; i < numberOfPeople; ++i)
{
if(pancakes[i] > largestAte)
{
largestAte = pancakes[i];
personWhoAteMost = person[i];
}
}