Arbitrarily define a char type string array, with char string[] = "iphone", for example.
Implement Strlen
Char string[] = "iphone";
int i = 0;
while (string[i]! = ' + ') {
i + +;
}
printf ("%d", I);
Implement strcpy
Char string1[20] = "ios";
Char string2[] = "Android";
strcpy (STRING1,STRING2);
int i = 0;
while (string2[i]! = ' + ') {//the computer recognizes the string after ' \ ", the condition is set, the copy stops
String1[i] = String2[i];
i + +;
}
String1[i] = ' + '; The first string is ' + ' and the string is finally added
printf ("%s", string1);
Implement Strcat
Char string1[] = "ios";
Char string2[] = "Android";
long int length = strlen (string1);
int i = 0;
while (string2[i]! = ' + ') {//Computer until recognized '/', the condition is set, stitching stops
String1[i + length] = String2[i];
i + +;
}
String1[i + length] = ' + '; Plus the length of the destination string
printf ("%s", string1);
Write instructions on how strlen, strcpy, strcat are implemented