Comparing strings...
Al Dunbar
userAKDU at mts.ucs.UAlberta.CA
Mon Oct 15 14:15:14 AEST 1990
In article <2205.271700c2 at cc.nu.oz.au>, v8902058 at cc.nu.oz.au writes:
>
>
>Hello...
>
> I'm sorry if this is a trival task, but I would like a function that
>compares two strings. I would like to be able to find if a string is equal to,
>less than, or greater than another string. I tried writing a routinue myself,
>but I just can't seem to do it, so I thought I'd ask.
>
> I wouldn't mind some code, or just the basic algorithm maybe.
>
> If anyone can help me, please email or post...
>
>Thanks.
>
>Bernard.
If you have a C compiler, you probably already have such a
function; just #include <string.h> and then use routines
such as strcmp, stricmp, and strncmp as probably defined
in the manual.
-------------------+-------------------------------------------
Al Dunbar |
Edmonton, Alberta | this space for rent
CANADA |
-------------------+-------------------------------------------
More information about the Comp.lang.c
mailing list