#include<stdio.h>
void display(int n, char *str[])
{
int i=0;
while(i<n) printf("%s ",str[i++]);
}
int main()
{
display(1,"Hello");
return 0;
}
**ptr = *ptr[]
Well, char **ptr is a double pointer (pointer to a pointer) of char while char *ptr[] is an open array of pointer to char.
According to cdel, char **p; gives the result of "declare p as pointer to pointer
to char" while char *p[]; gives "declare p as array of pointer to char."
Character strings are always arrays, and arrays are generally always pointers,
so the two are generally equivalent which means that **ptr = *ptr[].
What you end up with is an array of an array of chars, or an array of strings.
Take main() for instance:
https://[Log in to view URL]
To embed this program on your website, copy the following code and paste it into your website's HTML: