#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
int strlen_(char *arr){
if (*arr != '\0'){
  return 1 + strlen_(arr + 1);
 }
 else
  return 0;
}
int main(){
 char *a = "abcdef";
 int ret = strlen_(a);
 printf("%d\n", ret);
 system("pause");
 return 0;
}

[C语言]递归实现strlen

相关文章:

  • 2021-12-30
  • 2021-08-27
  • 2021-11-18
  • 2021-05-31
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-26
  • 2021-07-19
  • 2021-06-11
  • 2021-11-17
  • 2021-12-08
相关资源
相似解决方案