Reputation: 1074
While digging in some C source code I found that fragment of code
char **words
I know that single asterisk before variable name "points" to pointer, but what is the purpose of those two asterisks ?
Upvotes: 14
Views: 10223
Reputation: 108978
// your imagination is the limit
char letter;
char *word; // sequence of letters
char **sentence; // sequence of words
char ***paragraph; // sequence of sentences
char ****book; // sequence of paragraphs
char *****library; // sequence of books
The data structure is probably not the best to represent the concept: this is just an illustration.
Upvotes: 7
Reputation: 338
simple dude! it points to the pointer thats it
**a points to the pointer *a thats it.
For more information you can google it
Upvotes: -2
Reputation: 1837
It is a pointer to a pointer.
It is used primarily when you use an array of character strings.
For example: you have char sample[5][5]
; - this can store 5 strings of length 4;
If you need to pass it to a function, func(sample)
;
And the function definition of such a function would be func(char **temp)
;
Upvotes: 11