I have two strings, str1 and str2. I want the concatenation of them on a space in the heap. I malloc space for them using:
char *concat = (char*) malloc(strl
You want to do a strcpy and then a strcat:
strcpy(concat, str1);
strcat(concat, str2);
strcat relies on there being a null terminator ('\0') to know where to begin. If you just malloc and strcat, it's going to do some nasty things.
And no, neither strcpy nor strcat will do any kind of implicit allocation or reallocation.