缘由https://bbs.csdn.net/topics/397667834
void string声明的字符串这么相加()
{
//缘由https://bbs.csdn.net/topics/397667834
struct teacher { string name; };
teacher t[3];
string teachernameseed1 = "张赵王";//把字符串放入种子中
string teachernameseed2 = "三四五";
int length = sizeof(t) / sizeof(t[0]);
for (int i = 0, a = 0; i < length * 2; i += 2, a++)
{
t[a].name = teachernameseed1.substr(i, 2);//对种子按位链接
t[a].name += teachernameseed2.substr(i, 2);
}
for (int i = 0; i < length; i++)cout << "姓名:" << t[i].name << endl;
}