Command Line Arguments

#include <stdio.h>

// The program now accepts command line arguments
int main(int argc, char *argv[])
{
    if(argc == 1)
    {
        printf("argv[0]: %s\n", *argv);
    }

    else if(argc == 2)
    {
        printf("argv[1]: %s\n", *++argv);
    }

    return 0;
}

By adding two arguments to the main function, you can enter command line arguments when running the program from the terminal. argc is the argument count, an integer of the amount of arguments entered in the terminal. char *argv[] is an array of character pointers, and the first is a string that is the program name.