Write a string link function yourself: The function is defined as void fun (char A[],char b[]), and it functions by connecting the order of characters in the shape parameter group B to the string of the parameter group A. Note: You cannot use the copy and join functions of a string. For example: A string in Hello,b is 123, and the content in string A is hello123.
The main function enters two strings to the character array str1 and STR2, calls the fun function, implements the connection of the two strings, and outputs the concatenated string.
#include <stdio.h>
#include <string.h>
int main ()
{
void Fun (char A[],char b[]);
Char str1[100],str2[100];
Gets (STR1);
Gets (STR2);
Fun (STR1,STR2);
return 0;
}
void Fun (char A[],char b[])
{
int num1=0,num2=0,i;
Num1=strlen (a);
Num2=strlen (b);
for (i=0;i<=num2;i++)/*i<=num2 instead of i<num2, because the \ in array b is not assigned to array A, the array A does not have an output ending symbol, resulting in garbled output */
{
A[num1++]=b[i];
}
printf ("%s", a);
}
(experiment 6) String link function (not used)