User Profile

Collapse

Profile Sidebar

Collapse
ajb1983
ajb1983
Last Activity: Mar 13 '08, 12:12 AM
Joined: Feb 28 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ajb1983
    replied to Sorting 2d array by members of 1st row
    in C
    Yes, thanks for that Ganon11.

    I will probably try the struct method once I have time since it seems neat.
    In the meantime, I had actually blundered through with the following, which works:

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    int values[2][6] = {
    				{4, 1, 10, 9, 2, 5 },
    				{1, 2, 3, 4, 5, 6}
    				};
    int values_comp[2][6] = {
    				{4, 1, 10,
    ...
    See more | Go to post

    Leave a comment:


  • ajb1983
    started a topic Sorting 2d array by members of 1st row
    in C

    Sorting 2d array by members of 1st row

    Dear users,

    I have just registered with this forum, and introduced myself as such:
    http://www.thescripts.com/forum/thread776349.html

    My question regards a 2d array, to be sorted according to the first row, such that an array such as
    {4,6,3,7,2},{1, 2,3,4,5} would be sorted to
    {2,3,4,6,7},{5, 3,1,2,4}
    I have taken the following example code from an FAQ on the internet, but cannot make it work...
    See more | Go to post
No activity results to display
Show More
Working...