Thread: Need help with sorting code

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    4

    Post Need help with sorting code

    Hello,

    I have an array of strings as shown below:

    1=a
    0=b
    3=c
    10=d
    2=e
    4=f

    I need to sort the above strings in the ascending order of the numbers that are part of the strings. I want the output as below:

    0=b
    1=a
    2=e
    3=c
    4=f
    10=d

    Can anyone help me with the "C" code to sort in the above way

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,675
    Is this the same sorting as 4.5 years ago?
    c program for sort and remove duplicate values from an array
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with my Sorting code.
    By John120788 in forum C Programming
    Replies: 8
    Last Post: 07-12-2013, 04:06 AM
  2. Need help sorting structure by male/female and zip code
    By usmcrewcheif in forum C Programming
    Replies: 3
    Last Post: 05-18-2010, 01:16 AM
  3. Zip Code Sorting
    By Shamino in forum C++ Programming
    Replies: 14
    Last Post: 10-26-2009, 04:20 PM
  4. Sorting linked list please help with CODE
    By scarlet00014 in forum C Programming
    Replies: 3
    Last Post: 09-27-2008, 11:24 PM
  5. Complete beginner needs help customising sorting code
    By Ian SH in forum C++ Programming
    Replies: 4
    Last Post: 11-03-2007, 07:09 PM