Reading code, I see individuals pass command-line arguments to main()
in two different ways. Often, and the way I choose to do it, is a pointer to an array containing the arguments (char *argv[]
). I will also see code which uses a pointer to a pointer to the argument(s) instead (char **argv
).
These seem very similar and I'm not sure whether there is any pragmatic reason for choosing to do this one way or another. Could anybody let me know why?