main:entry point of C program
Table of Contents
In C, the entry point is the main function int main(){}
.
#include <stdio.h> int main(int argc, char args *argv[]){ }
- argc
- number of arguments, including path to binary
- argv
- array of strings, each being a argument seperated with space
After being compiled to binary e.g. /tmp/a.out
, calling /tmp/a.out 3 2 my -i
execute main
with:
argc = 5
argv = ["tmp/a.out" "3" "2" "my" "-i"]