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