strstr和memcmp函数的实现
摘要:
#include #include //malloc()函数typedef unsigned int size_t;size_t my_strlen(const char * str){ const char *sc = NULL; if(str == NULL) return 0; for(sc = str;*sc != '\0';sc++) { /* do nothing */ } return sc - str;}/* 因为类型可以为任意,所以形参应为void * * 相等则返回0,否则不为0 */int my_memcmp(const void *s1,cons... 阅读全文
posted @ 2013-10-10 22:10 新一 阅读(595) 评论(0) 推荐(0)
浙公网安备 33010602011771号