So I called on that function three times on separate occasions which I feel the way that it was done was inefficient and a waste. I know I have kind of beat around the bush to this point, but is there an easier way to call a function multiple times?
How would I use variables in the situation though. As if the number1, number2, and number3 were changing so I would never know the number at every given point to put into the function. How would I set it up so it would use whatever the variables are equal to?
const std::size_t N = 3 ; // three numbers
int numbers[N] ; // array of N int
for( int& i : numbers ) std::cin >> i ; // for example, read in N numbers
for( int n : numbers ) std::cout << doStuff(n) << '\n' ;
int a, b, c ;
std::cin >> a >> b >> c ;
for( int n : { a, b, c } ) std::cout << doStuff(n) << '\n' ;