nvnnaidenov

Zad59

Oct 19th, 2021
731
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool Eqstrs(char*, char*);
  6.  
  7. int main()
  8. {
  9.     bool isTrue = false;
  10.     char* firstString = "This is first test";
  11.     char* secondString = "This is first test";
  12.  
  13.     isTrue = Eqstrs(firstString, secondString);
  14.  
  15.     cout << isTrue << endl;
  16.  
  17.     return 0;
  18. }
  19.  
  20. bool Eqstrs(char* s, char* t)
  21. {
  22.     while(*s == *t && *s)
  23.     {
  24.         s++;
  25.         t++;
  26.     }
  27.  
  28.     return *s == *t;
  29. }
  30.  
  31.  
RAW Paste Data