The main function

Unlike Java the main function is a special function in C. It is the first programmer defined function that is called (we will see that there is a lot going on in a program before main is actually called). Its job is to transport command line parameters into the program and to return a result value to whoever started the program. That is why main returns an integer value.

  int main(void) { /* body */ }  // no command line args
  int main(int argc, char** argv) { /* body */ } // with args

The expression "char** argv" stands for a pointer to pointer to characters. We know now that a string is a pointer to characters. So we have a pointer to string(s). And those strings are the command line arguments. Another way to express this would be char* argv[] which is an array of pointers to characters (strings).