What does this program do, assuming that the user enters two strings of the same length?
1 // ex07_19.c
2 // What does this program do?
3 #include
4 #define SIZE 80
5
6 void mystery1(char *s1, const char *s2); // prototype
7
8 int main(void)
9 {
10 char string1[SIZE]; // create char array
11 char string2[SIZE]; // create char array
12
13 puts("Enter two strings: ");
14 scanf("%79s%79s" , string1, string2);
15 mystery1(string1, string2);
16 printf ("%s", string1);
17 }
18
19 // What does this function do?
20 void mystery1(char *s1, const char *s2)
21 {
22 while (*s1 != '\0') {
23 ++s1;
24 }
25
26 for (; *s1 = *s2; ++s1, ++s2) {
27 ; // empty statement
28 }
29 }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.