Comparing strings...

Dale Cook cdm at gem-hy.Berkeley.EDU
Tue Oct 16 11:20:56 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.

Try "strcmp".

--- Dale Cook

Neither the United States Government nor the Idaho National
Engineering Laboratory nor any of their employees, makes any warranty,
expressed or implied, or assumes any legal liability or responsibility
for the accuracy, completeness, or usefulness of any information,
product, or process disclosed, or represents that its use would not
infringe privately owned rights.  Reference herein to any specific
commercial products, process, or service by trade name, trademark
manufacturer, or otherwise, does not necessarily constitute or imply
its endorsement, recommendation, or favoring by the United States
Government or the Idaho National Engineering Laboratory.  The views and
opinions of authors expressed herein do not necessarily state or reflect
those of the United States Government nor the Idaho National Engineering
Laboratory, and shall not be used for advertising or product endorsement
purposes.



More information about the Comp.lang.c mailing list