Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int strlenRec(const char* str)
- {
- if (*str == '\0')
- return 0;
- return 1 + strlenRec(str + 1);
- }
- int main()
- {
- cout << strlenRec("test");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement