I am still trying to understand about doublepointers.
I do know how double pointers are usually used in most cases like
void foo(char **ptr)
{
// blah
}
int main(void)
{
char *ptr;
foo(&ptr);
}
However i have no idea what one does differently than the other
int main(int argc, char **argv) //Double pointer
int main(int argc, char *argv[]) // Single
When used as a parameter to a function, an array designator
[]is exactly the same as a pointer. The two declarations you have formainare in fact identical.There are times when the two different syntaxes mean different things, but this isn’t one of them.
In this case it means you have an array of pointers. Each pointer points to an array of characters.
argv[0]is a pointer to the firstchar*string,argv[1]is a pointer to the secondchar*string, etc.