To compile a C program on a Linux system, use the gcc command. This command takes a C program as its argument and compiles it to an executable program called, by default, a.out:
$ gcc hello.c $ ./a.out Hello World!
If you want the program to be something other than a.out, it can be specified after the -o flag:
$ gcc hello.c -o hello $ ./hello Hello World!
For this program you will write a function which reverses a string in place. Recall that passing a string into a function means passing a pointer to a char. After calling the reverse function, the string should be reversed.
You should also write a main function which reads in a string of size up to 100 with scanf, calls your reverse function, and then prints the result with printf.
$ ./reverse Enter a string: abcd dcba $ ./reverse Enter a string: abcde edcba
Copyright © 2022 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.