argv

Every C program is required to have a main function. There are two possible function signatures for main - the full one is

int main(int argc, char *argv[]);

but you're also allowed to omit the arguments so it's just int main();.

From its type, you can infer that argv is an array of char* - so it's an array of strings. In C, there's no way to know the length of an array without being separately told; fortunately, we are told it, as argc is always given as the length of argv.

What is argv? It represents the command used to invoke the program being run. For example, if I invoke a C program like

./myprogram myfile.txt -f --speed fast

then argc would be 5 and argv would be the array

["./myprogram", "myfile.txt", "-f", "--speed", "fast"]

Notice that ./myprogram is part of this array, despite the name argv sounding like it should only contain the ARGuments. Sometimes programs don't know who they are and need someone to help them out. I think we all feel that way sometimes.