Advertisement
KShah

Untitled

Nov 11th, 2021
1,226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. String operator+(const char lstr, const String& rstr) {
  2.     String copy(1, lstr);
  3.     copy += rstr;
  4.     return copy;
  5. }
  6.  
  7. String operator+(const String& lstr, const char rstr) {
  8.     String copy = lstr;
  9.     copy.push_back(rstr);
  10.     return copy;
  11. }
  12.  
  13. String operator+(const String& lstr, const String& rstr) {
  14.     String copy = lstr;
  15.     copy += rstr;
  16.     return copy;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement