填空完成 String 对象和字符的连接运算'+',并能够满足交换律 要求,操作数中的string对象不改变

【问题描述】填空完成 String 对象和字符的连接运算'+',并能够满足交换律
要求,操作数中的string对象不改变
【样例输入】

hello a

【样例输出】

helloa

ahello

hello

(最后一行为string对象,验证没有改变)
【样例说明】
【评分标准】

// Example program
#include
//#include <string.h>//特意注释掉的,纯手工实现
using namespace std;
class String {
public:
String(){ p=NULL; len = 0;}
String( char *str ) {p=str; }
void display() {cout<<p<<endl;}
int getLen(){

  }
  char*  getP(){return  p;}
  
//类内定义和声明重载的“+”

private:
char *p;
int len;
};

int main() {
char s1[10], c;
cin >> s1 >> c;
//cout << "+" << s1 << "+" << c << "+"<<endl;
String string1(s1);
String string2 = string1+c;
string2.display();
string2 = c+string1;
string2.display();
string1.display();
return 0;
}