Objective-c main routine, what is: int argc, const char * argv[]

后端 未结 6 1359
长情又很酷
长情又很酷 2021-02-05 07:40

What are the arguments passed into the main method of a command-line program:

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

what is the first int mea

6条回答
  •  遥遥无期
    2021-02-05 08:14

    That main is from C and not specific to objective-c. Argc gives you the number of command line arguments passed to your C program. Argv is an array of C strings and contains the command line arguments.

    You would use them and the command-line project any time you wanted to write a command line tool or a program you interact with from the command line.

提交回复
热议问题