qsort can sort any way you want, you just have to provide your own
comparison function.

from qsort(3)
The  comparison  function  must return an integer less than, equal to, or
greater than zero if the first argument is considered to be respectively
less than, equal to, or greater than the second.  If two  members compare as
equal, their order in the sorted array is undefined.

from strcmp(3)
The strcmp() function compares the two strings s1 and s2.  It returns an
integer less than, equal to, or greater than zero if s1 is found,
respectively, to be less than, to match, or be greater than s2.

See how nicely that works out?

----- Original Message -----
From: "Dale Kingston" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 29, 2003 4:31 PM
Subject: Re: Sorting skills Alphabeticly


> How would I go about using qsort for an alpha sorting, looks like it just
> does numbers.
>
> ----- Original Message -----
> From: "Charles" <[EMAIL PROTECTED]>
> To: "Dale Kingston" <[EMAIL PROTECTED]>
> Cc: <[email protected]>
> Sent: Tuesday, April 29, 2003 11:15 AM
> Subject: Re: Sorting skills Alphabeticly
>
>
> > qsort
> >
> > ----- Original Message -----
> > From: "Dale Kingston" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Tuesday, April 29, 2003 10:03 AM
> > Subject: Sorting skills Alphabeticly
> >
> >
> > > I was wondering if anyone knew of a library or away that I could sort
> > > something alphabeticly. I'm having a problem with a new skill I added
> > cause
> > > it's called shock. And I have a skill that comes before it in the
table
> > > called shocking blade so now I can't edit shock and it won't give it
to
> > the
> > > class as a basic cause that class doesn't get shocking blade. So any
> help
> > on
> > > a library or a way that I could sort alphabeticly would be nice. I'm
> using
> > > if you curious olc 2.01+ I know how to work with the table I just
wasn't
> > > sure if a skill_table[sn].name[0] > skill_table[sn+1].name[0] type of
> > thing
> > > would work or not. Thanks in advance
> > >
> > >
> > > --
> > > ROM mailing list
> > > [email protected]
> > > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> >
> >
> >
> > --
> > ROM mailing list
> > [email protected]
> > http://www.rom.org/cgi-bin/mailman/listinfo/rom
> >
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom


Reply via email to