If I have,
matrix1[4][4] = { 'a','b','c','d',
'e','f','g','h',
'i','j','k','l',
'm','n','o','p'}
string1[50] = "text"
how do you go about adding a character from the matrix into the string? like if I wanted "g" added to "text" to make like string2 = textg
strcat doesn't take these parameters. Can I do something like making a separate char string2 = matrix1[2][3] and append that to string1? But what if i want more than 1 char like g and k to make textgk.
strncat(string1, matrix1[1][2], 1);strncat(string1, matrix1[2][2], 1);orchar string2[50]; snprintf(string2, sizeof(string2), "%s%c%c", string1, matrix1[1][2], matrix1[2][2]);. note matrix1[1][2] : 'g' , matrix1[2][2] : 'k', matrix1[2][3] : 'l'