Now that we are into C proper of our journey here at 42, we will be writing, testing, and reviewing C coding assignments. We want this process to be as fast and efficient as possible which is why it is in our interest to automate whatever we can.
Some assignments we write are not expected to include a main function upon submission, even though it is impossible to compile and test C code locally without one. For those of us who use Vim, we can make this process a little less painful than the current process. Many of us have found ourselves needing to carry out the following mindless steps:
- Uncomment an existing test main function (or create a new one)
- Switch terminals or exit out of Vim so that you have the command line accessible
- Run
cc -Wall -Wextra -Werror <filename>(which outputs an a.out file by default) - Run the default a.out file
./a.outso that you can check the output