+ 8
What dose int main(int argc, char ** argv) mean?
what dose it do?
5 Respuestas
+ 6
it takes an integer argument and a pointer to a char array, sometimes you use double pointers to point to a multi dim array, atleast that is how i have seen it used. but i could be wrong, i havent seen it used within a main function LONGTIE👔 so argv is an array of pointers to characters and argc is the number of elements within the array of pointers
+ 7
Ok, thank you for clearing that up. @Robert Atkins,
hmmm... you cant metion ppl on the computer site...
weird
+ 7
int argc is count of number of arguments provided through command line arguments and char **argv is 2 dimensional array of real arguments provided through command line.
+ 2
Your program are always executed by command line. Program, that runs your program, provides array of strings as an launch parameters. For example it could be a file names to work with.
The result of your program should be returned as an integer number in the result of the main function. That number could be checked by parent program.
For example you can use shell script to pass arguments to your program and check it's result.