[cpp] view plain copy int strcmp(const char *dest, const char *source) { assert((NULL != dest) && (NULL != source)); while (*dest && *source && (*dest == *source)) { dest ++; source ++; } return *dest - *source; }