Question: Please write this code in C not C++ I just need the reverse code at the bottom made thanks! Here is the code I have
Please write this code in C not C++ I just need the reverse code at the bottom made thanks!
Here is the code I have so far.
#include
#include
#include
#include
void reverse(char *);
int main(int argc, char *argv[]) {
for (int a=argc-1; a>=0; a--) {
reverse(argv[a]);
printf("%s" ", argv[a] );
}
return 0;
}
void reverse(char * str) {
return;
}
1. Name this program reverse.c-This program prints all the command-line arguments last argument to the first, printing each word backwards). Two sample executions are shown below /a.out Crimson Tide Alabama UA ./a.out hello world dlrow olleh tuo.a/. AU amaba1A ediT nosmirC tuo.a/. (a character Your program must use a function to reverse the arguments. This function takes a single argument string) and modifies that character string. You can write the function signature for this function in either of the ways shown below (since the name of an array is also a pointer to the start of the array). void reverse (char *) void reverse (char1) Hint - the algorithm in zyBooks 5.8 for reversing an array of integers can also be used to reverse a word
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
