// This program demonstrates how command line arguments // work in C and what they are (yay being able to take input straight up!) // Week 4 Lecture 8 #include // Note here: if we want to take in arguments, we will change void to // signal that there are inputs into the main... argc is the count of // the number of arguments, and argv[] is the actual arguments themselves int main (int argc, char *argv[]) { printf("There are %d command line arguments in this program\n", argc); // argv[0] is always the program name printf("The program name is %s (argv[0])\n", argv[0]); // What about the other command line arguments? Let's loop through // the array and print them all out! for (int i = 0; i < argc; i++) { printf("argv[%d] is %s\n", i, argv[i]); } return 0; }