最新更新strncpy strstr函数
学过C语言都知道的几个str函数,同学面试腾讯的时候也问到了strlen的递归实现,我也给出来~
- strlen的实现
1 #include<iostream> 2 #include<cassert> 3 using namespace std; 4 5 6 int my_strlen(const char * str) 7 { 8 assert(str); 9 int count = 0; 10 const char *ptr = str; 11 while (*(ptr++) != '