//mystrcmp.cpp
#include <iostream>#include <string>#include <cassert>using namespace std;int mystrcmp(const char * p1, const char * p2);int main() { char a1[] = "happy new year"; char a2[] = "happy new year"; cout << mystrcmp(a1,a2) << endl; return 0; }
int mystrcmp(const char * p1, const char * p2){ if( p1 == NULL || p2 == NULL ) { return -2;} while( *p1 && *p2) { if( *p1 > *p2) return 1; ......
阅读全文