warning: Incompatible integer to pointer conversion assigning to 'char *' to int
Hi all, when I use the function to concat the pointer, the warning message is come out (Incompatible integer to pointer conversion assigning to 'char *' to 'int'), how can I fix this, many thanks!!
Code:
char* concat(char* left,char* right)
{
char* all = malloc(strlen(left)+strlen(right)+1);
strcpy(all, left);
strcat(all, right);
puts(all);
free(all);
return all;
}
//use the concat function like this:
char* all;
char* tmp="abc";
all = concat("06",tmp); //warning msg here "sc means concat"