jeudi 13 août 2015

Why does main(int argc, char* argv[]) take two argument?

I always thought that argc was required to mark the end of argv but I just learned that argv[argc] == nullptr by definition. Am I right in thinking that argc is totally redundant? If so, I always thought C made away with redundancy in the name of efficiency. Is my assumption wrong or there's a historic reason behind this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire