code.cpp 192 B

123456789
  1. /* Write a function that returns the length of a string.
  2. * Make your function recursive.
  3. */
  4. int length(std::string str) {
  5. while(str==str){
  6. int length = str.size();
  7. return length;
  8. }
  9. }