How do I write my own min and max functions?

I know I need to use a for loop and compare it to each item in my array, but I am unsure how to set the min and maximum by doing this. All I have right now is the beginnings of a for loop, and my array elements are already defined.

No matter what I put in my array, it fails upon compilation because it tells me I can't have a variable set as an array. I've not the slightest clue what to say. I tried everything I can think of.
Last edited on
Set both the min and the max to the first element in the array before you start looping. This will make sure every number in the array is compared to them.

If you need any more help post your code you have started on and we can continue from there.
My instructor helped me a lot on this but I was also told this. Thanks for your help!
Topic archived. No new replies allowed.