Thread: Maximum in an array

  1. #1
    Registered User
    Join Date
    May 2016
    Posts
    4

    Maximum in an array

    Hey there I need some help with a c code. I need to find the maximum of an array and insert it in the array once again after the position of the maximum

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What idea do you have in mind? What have you tried? Notice that your task has two parts: finding the maximum and re-inserting it. Have you at least done the finding of the maximum?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2016
    Posts
    4
    yeah i can find the maximum but dont know how to reinsert it into that exact position

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Okay, so what is your current code?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Maximum ascending sequence in array
    By DonBasil in forum C Programming
    Replies: 1
    Last Post: 04-16-2010, 06:39 PM
  2. Finding the maximum in an array
    By Turtal in forum C Programming
    Replies: 4
    Last Post: 11-15-2006, 07:07 AM
  3. Help!Maximum array size in C?
    By robin in forum C Programming
    Replies: 10
    Last Post: 04-02-2005, 11:57 PM
  4. Maximum size of an array in C
    By mehdi_etebari in forum C Programming
    Replies: 8
    Last Post: 02-01-2005, 09:50 AM
  5. Maximum array size?
    By code2big in forum C Programming
    Replies: 2
    Last Post: 05-25-2004, 08:16 AM

Tags for this Thread