hello dawei,
there is a problem the defination of strcat is
Code:
strcat(int * a, int *b)
it will only take inside pointers ,so if you want it to work with add
it will be
Code:
#include<iostream>
#include<cstring>
char *add(int *a, int *b)
{
strcat(a,b);
return *a;
}
int main()
{
char a[] = "hi";
char b[] = "world";
cout<<endl<<add(a,b);
return 0;
}
OUTPUT:
hiworld
but with error and terminated