nvnnaidenov

Zad58

Oct 19th, 2021
702
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int len(char* s)
  6. {
  7.     int count = 0;
  8.  
  9.     while(*s)
  10.     {
  11.         count++;
  12.         s++;
  13.     }
  14.    
  15.     return count;
  16. }
  17.  
  18. int main()
  19. {
  20.     char* str = "This is test string";
  21.  
  22.     cout << "Length of the string is: " << len(str) << endl;
  23.  
  24.     return 0;
  25. }
RAW Paste Data