void 连接字符串不用string头文件(char* a, char* aa, char* aaa)
{
int z = 0, d = 0, dd = 0;
while (a[d++] != '\0'); --d;
while (aa[dd++] != '\0'); --dd;
while (z < d)aaa[z] = a[z++]; z = 0;
while (z < dd)aaa[d + z] = aa[z++];
}
void 连接字符串不用string头文件(char* a, char* aa,char* aaa)
{
int z = 0, d = sizeof(a), dd = sizeof(aa);
while (z < d)aaa[z] = a[z++]; z = 0;
while (z < dd)aaa[d + z] = aa[z++];
}
char aa[] = "qwertyuiop", aaa[] = "polkmn";
int a = 0, e = sizeof(aa), ee = sizeof(aaa);
//*字符串尾部应该有个'\0'作为字符串结尾标志,所以申请空间应该多申请一个,并可直接赋值给结尾,否则发生有奇怪的后面有"铪铪"*
char* d = new char[e + ee - 1]{}; //d[e + ee] = '\0';
连接字符串不用string头文件(aa, aaa, d);
while (a<e + ee)cout << d[a++];
delete[] d;
void 连接字符串不用string头文件(char* a, char* aa, char* aaa)
{
int z = 0, d = strlen(a), dd = strlen(aa);
strcpy_s(aaa, strlen(aaa), a);//C 库函数 size_t strlen(const char *str) 计算字符串 str 的长度,直到空结束字符,但不包括空结束字符。https://www.runoob.com/cprogramming/c-function-strlen.html
//while (z < d)aaa[z] = a[z++]; z = 0;
while (z < dd)aaa[d + z] = aa[z++];
}