Advertisement
yudakov1814

Untitled

Apr 10th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. void strcpy(char target[], const char source[]) {
  2.     while (*target++ = *source++);
  3. }
  4.  
  5. int strcmp(const char lhs[], const char rhs[]) {
  6.     while (*lhs || *rhs) {
  7.         if (*lhs++ != *rhs++) {
  8.             return *(lhs - 1) - *(rhs - 1);
  9.         }
  10.     }
  11.     return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement