#include <iostream>
using namespace std;
template <typename T>
T total(T numValues)
{
}
int main()
{
cin.ignore();
cin.get();
return 0;
}
Write a template for a function called total. The function should keep a running total of values entered by the user, then return the total. The argument sent into the function shuold be the number of values the function is to read. Test the template in a simple driver program.
This problem is easy enough to set up(like I did up top), but I dont exactly get what the function is supposed to do. Do I need to pass it an array or vector that is filled by a user in main using a loop? Then add the elements? How do you guys decipher this text =(
Thanks