Question: A- What does the following function do? Explain. int guess (char string[]) { int len strlen(string); int i; char tmp; for (i = 0;

A- What does the following function do? Explain. int guess (char string[])

A- What does the following function do? Explain. int guess (char string[]) { int len strlen(string); int i; char tmp; for (i = 0; i < len / 2; i = 1 + 1) ( tmp = string[i]; string[i] = string [len 1 - 11; string [len 1 - 1] = tmp; = } return 0; B- Rewrite the function using pointers.

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer A The function reverses the string Inside the loop we can observe that we are sw... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!