I read an article (forgot the URL), which said that argv[argc]
is a NULL
pointer (contains \0
). To check whether if its true I wrote this code, yeah it exist. What I don't understand is, why does the OS include this NULL
pointer at argv[argc]
. Is it useful for something else also?
int
main (int argc, char **argv){
while (*argv)
printf ("%s\n", *argv++);
return 0;
}