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

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 = i + 1)

{

tmp = string[i];

string[i] = string[len - i - 1];

string[len - i - 1] = tmp;

}

return 0;

}

B- Rewrite the function using pointers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!