Answers for "a function that concatenates a string to another in c without using strcat"

C
1

c concatenate strings without using strcat or strcpy

#include <stdio.h>
int main()
{
   char str1[50], str2[50], i, j;
   
   scanf("%s",str1);
   scanf("%s",str2);
   
   for(i=0; str1[i]!='\0'; ++i); 
 
   for(j=0; str2[j]!='\0'; ++j, ++i)
   {
      str1[i]=str2[j];
   }
   str1[i]='\0';
   printf("\n%s",str1);
   
   return 0;
}
Posted by: Guest on June-29-2021

Code answers related to "a function that concatenates a string to another in c without using strcat"

Code answers related to "C"

Browse Popular Code Answers by Language