max_element() from <algorithm> returns an iterator to the maximum element in a sequence.

Edit: If you insist on writing your own implementation, you probably want to express the input as a sequence in the same way that the Standard Library does, so you don't have to deal with variadic functions.

A variadic function is one that can take a variable number of arguments. For your purposes, you probably don't want to create one of those. Look at the example in the link above and then create a function that works the same way that max_element() does, or just use max_element(). max_element() is NOT variadic - it takes just two arguments (or three if you use the generalized version).