8#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
28 static bool str_equal(
const char* a_,
const char* b_)
30 return strcmp(a_, b_) == 0 ? 1 : 0;
41 int v1[6] = { 1, 1, 2, 3, 5, 8 };
42 int v2[6] = { 0, 1, 2, 3, 4, 5 };
55 typedef vector <int> IntVec;
75 char const* grades[] = {
"A",
"B",
"C",
"D",
"F" };
76 char const* letters[] = {
"Q",
"E",
"D" };
77 const unsigned gradeCount =
sizeof(grades) /
sizeof(grades[0]);
78 const unsigned letterCount =
sizeof(letters) /
sizeof(letters[0]);
79 char const**
location =
search((
char const**)grades, (
char const**)grades + gradeCount, (
char const**)letters, (
char const**)letters + letterCount,
str_equal);
83 copy((
char const**)grades + 1, (
char const**)grades + 1 + letterCount, (
char const**)letters);
84 location =
search((
char const**)grades, (
char const**)grades + gradeCount, (
char const**)letters, (
char const**)letters + letterCount,
str_equal);
int strcmp(const char *String1, const char *String2)
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
static bool str_equal(const char *a_, const char *b_)
CPPUNIT_TEST_SUITE(SearchTest)
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
#define CPPUNIT_ASSERT(X)
GLfloat GLfloat GLfloat GLfloat v3
GLfloat GLfloat GLfloat v2
void __iota(_It __first, _It __last, _Tp __val)
static short search(int val, const short *table, int size)