常见递归&非递归实现
摘要:
void my_strcpy(char *to,const char *from){ if('\0' == *from){ *to = '\0'; return ; } *to++ = *from++; my_strcpy(to,from);}//只拷贝n个字符void my_strncpy(char *to,const char* from,int n){ if( 0 == n || '\0' == *from){ *to = '\0'; return ; } *to++ = *from++; ... 阅读全文
posted @ 2014-03-22 21:48 程良 阅读(463) 评论(0) 推荐(0) 编辑