Advertisement
KristianIvanov00

Untitled

Jan 6th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int strlenRec(const char* str)
  5. {
  6. if (*str == '\0')
  7. return 0;
  8.  
  9. return 1 + strlenRec(str + 1);
  10. }
  11.  
  12. int main()
  13. {
  14. cout << strlenRec("test");
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement