Question: Write a function reverse(s) that reverses the character string s. Use it to write a program that reverses its input a line at a time.

Write a function reverse(s) that reverses the character string s. Use it to write a program that reverses its input a line at a time.
Please tell me where I have to make changes. Thanksyou.  Write a function reverse(s) that reverses the character string s. Use
it to write a program that reverses its input a line at

1 #include 2 3 #define MAXLINE 1000 4 5 int getline2(char line[], int maxline); 6 void copy (char to[], char from []); 7 void reverse(char source(), char target()); 8 9 int main() 10 - { 11 int len; 12 int max; 13 char line [MAXLINE]; 14 char longest[MAXLINE]; 15 char rline [MAXLINE]; 16 17 max=0; 18 while((len = getline2(line, MAXLINE)) > 0){ 19 if(len > max){ 20 max = len; 21 copyClongest, line); 22 } 23 } 24 25 if(max > 0) 26 printf("%s", longest); 27 28 reverse(longest, rline); 29 printf(" reverse: %s ", rline); 29 printf(" reverse: %s ", rline); 30 31 return 0; 32 } 33 34 - int getline2(char so, int lim){ 35 int c, i; 36 37 for (i-0; i

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!