concatenates string str2 to end of string str1; string str1 must be big enough so as to accommodate the string str2: - C String

C examples for String:String Function

Description

concatenates string str2 to end of string str1; string str1 must be big enough so as to accommodate the string str2:

void strcat(char str1[], str2[])
{
  int j = k = 0;
  while(str1[j] != '\0')                      /* find end of str1 */
    j++;
  while((str1[j++] = str2[k++]) != '\0')      /* copy str2 to str1 */
    ;                                         /* null statement */
}

Related Tutorials