home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
1991
/
10
/
string
/
strigt.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-30
|
733b
|
29 lines
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <string.hpp>
int operator>(const String &a, const String &b)
{
int c, m = a.length(), n = b.length(), l = m > n? n: m;
if ((c = memcmp(a.body(),b.body(),l)) > 0) return 1;
if (!c && m > n) return 1;
return 0;
}
int operator>(const String &a, const char *s)
{
int c, m = a.length(), n = strlen(s), l = m > n? n: m;
if ((c = memcmp(a.body(),s,l)) > 0) return 1;
if (!c && m > n) return 1;
return 0;
}
int operator>(const char *s, const String &a)
{
int c, m = strlen(s), n = a.length(), l = m > n? n: m;
if ((c = memcmp(s,a.body(),l)) > 0) return 1;
if (!c && m > n) return 1;
return 0;
}