What are the valid signatures for C's main() function?

后端 未结 5 964
[愿得一人]
[愿得一人] 2020-11-22 05:05

What really are the valid signatures for main function in C? I know:

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

Are there other valid ones?

5条回答
  •  孤独总比滥情好
    2020-11-22 05:27

    POSIX supports execve(), which in turn supports

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

    The added argument is the environment, i.e. an array of strings of the form NAME=VALUE.

提交回复
热议问题