help with sort and function

This is a discussion on help with sort and function within the C++ Programming forums, part of the General Programming Boards category; Hey everybody i have a two dimentional array of [5][11]. i have a total of 50 numbers that will read ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    1

    help with sort and function

    Hey everybody i have a two dimentional array of [5][11]. i have a total of 50 numbers that will read in 5 rows and 10 collumns. My last collumn is currently set to 0. I have to creat a function to sort the numbers in descending order. its supposed to sort each individual row with only one function. Can someone help me please

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,247
    Work out how you would sort one row in descending order. Then place that logic in a loop, in order to iterate over all rows (sort one row at a time).

    And, no, I'm not going to provide code, as you would learn exactly nothing that way. You need to describe the logic of doing what you want on paper first. Once you have that description, the code will be trivial.
    Right 98% of the time, and don't care about the other 3%.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    2,268
    Do you have any code written so far that you're having specific problems with? If so, please post it, using code tags.

    If not, then you need to generate a sorting algorithm. Many already exist - but I suspect the idea of this assignment is to create one yourself. Further clarification of the assignment will help.

    Just make sure you read and understand the homework policy here, so that you won't ask the questions that will get you no help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fix sort function!
    By khoavo123 in forum C Programming
    Replies: 1
    Last Post: 02-21-2012, 06:31 AM
  2. sort function
    By compnub1 in forum C Programming
    Replies: 21
    Last Post: 05-01-2010, 03:30 PM
  3. sort function
    By compnub1 in forum C Programming
    Replies: 1
    Last Post: 04-30-2010, 09:57 AM
  4. Sort Function
    By Taka in forum C++ Programming
    Replies: 16
    Last Post: 05-23-2009, 02:18 PM
  5. sort function help
    By kashifk in forum C++ Programming
    Replies: 1
    Last Post: 09-16-2003, 04:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21