Jump to content

array help


iarnazca

Recommended Posts

Have you checked, what max() function returns? It returns the maximum value, not the index of this value in the array, so the conclusion is simple: you have to find another way. Have you thought of writing the maximum value searching algorithm yourself, so that you could program it to find the index, too. I won't give you a ready code - try to write it yourself. It's very easy: just scan the array, store the current maximum value in some extra variable and if you find a greater one, update it. At the same time, remember the index in another variable and that's all.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.