I want to append two strings. I used the following command:
new_str = strcat(str1, str2);
This command changes the value of str1
I needed to append substrings to create an ssh command, I solved with sprintf
(Visual Studio 2013)
char gStrSshCommand[SSH_COMMAND_MAX_LEN]; // declare ssh command string
strcpy(gStrSshCommand, ""); // empty string
void appendSshCommand(const char *substring) // append substring
{
sprintf(gStrSshCommand, "%s %s", gStrSshCommand, substring);
}