I want to append two strings. I used the following command:
new_str = strcat(str1, str2);
This command changes the value of str1
str1
You could use asprintf to concatenate both into a new string:
asprintf
char *new_str; asprintf(&new_str,"%s%s",str1,str2);