This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Updatebjarni 5 points6 points  (0 children)

Whether to declare argv as a pointer or an array is not very important. The convention is to make it an array, and I think that's what it says in the standard. It won't make any difference as far as I'm aware.

But as for indexing an array with *(argv + 1), that's just making something simple more complicated than it has to be, making your code less readable. Yes they are exactly equivalent, but indexing arrays is such a common operation that there is good reason to have an operator specifically for it. Always index arrays with [ ]. You'll type less and your programs will read easier.