Question: I need help writing a function in C programming called reverse that accepts as a parameter a character array or character pointer and returns void.
I need help writing a function in C programming called reverse that accepts as a parameter a character array or character pointer and returns void. The function should reverse the contents of the array or string being passed. For instance "Hello" would be reversed to "olleH". Should test it using a string showing before and after the reverse. It should not print the string in reverse, but reverse it in memory.
Also needs to do the same thing using a recursive function. Here's my original array:
#include
int main ()
{ char array[80];
printf("Enter a string: "); scanf("%[^ ]", &array); printf("%s ", array);
char * p;
p = array; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
