In this Appendix, you learnt the basics of command-line arguments in C++ programs. We saw that these arguments are potent tools that allow the users to pass information (such as filenames or values for parameters) to our programs during execution time.
We looked at some alternatives to command-line arguments that reinforced the fact that they are indeed the cleanest and the most effective way to deal with such cases. We also saw how we can exploit the argc
and argv
parameters to process the parameters inside our C++ code. Incorporating the practices that are discussed in this chapter will indeed make your code easier to maintain, user-friendly, and professional.