Problem

What does this program do, assuming that the user enters two strings of the same length?1...

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 }

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 7
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT