两个字符串连接问题
#include <iostream.h>char * f(int *a,int *b);
void main()
{ char m[4]="abc";
char n[3]="de";
char *k=char *f(m,n);
delete k;
}
char * f(int *a,int *b)
{int i,j;
char * s=new char[6];
for (i=0;i<4;i++)
s[i]=a[i];
for (j=0;j<3;j++)
s[j+4]=b[j];
return s-5;
}
请问这个错在哪里?