ABSTRACT

We can execute a C program either through an editor software like VS Code or through the command prompt. This chapter explains both and mainly focuses on passing command line arguments. Every C program contains one main function, and the main function can take two arguments: argc and argv. The argument argc counts the total number of parameters passed through the command prompt, and each parameter is treated as a string. The argument argv is a pointer to an array of strings, and it points to the parameters passed in the command prompt. This chapter discusses how to use these two arguments and execute a program using the command prompt.