O
Omats.Z
what is meaning os "char **option meet"?
I get a function like this:
__________________________________
int getchoice(char *greet, char *choices[])
{
int chosen = 0;
int selected;
char **option; // what is this line mean?
do {
printf("Choice: %s\n", greet);
option = choices;
while (*option) {
printf("%s\n", *option);
option++;
}
selected = getchar();
option = choices;
while (*option) {
if (selected == *option[0]) {
chosen = 1;
break;
}
}
if (!chosen) {
printf("Incorrect choice, select again\n");
}
} while (!chosen);
return selected;
}
__________________________________
I know "char *option" is a pointer. But what is the ** mean? If i
delete one *, this function can't be compiled!
PS: i compile it by GCC 4 on ArchLinux
I get a function like this:
__________________________________
int getchoice(char *greet, char *choices[])
{
int chosen = 0;
int selected;
char **option; // what is this line mean?
do {
printf("Choice: %s\n", greet);
option = choices;
while (*option) {
printf("%s\n", *option);
option++;
}
selected = getchar();
option = choices;
while (*option) {
if (selected == *option[0]) {
chosen = 1;
break;
}
}
if (!chosen) {
printf("Incorrect choice, select again\n");
}
} while (!chosen);
return selected;
}
__________________________________
I know "char *option" is a pointer. But what is the ** mean? If i
delete one *, this function can't be compiled!
PS: i compile it by GCC 4 on ArchLinux