I am curious how to pass pointer to pointer in the function as an argument. I checked different question, for example - C: How to pass a double pointer to a function , there people discuss that in order to pass pointer to pointer you need to pass pointer to pointer to pointer. e.g if I have
char **lines= malloc(sizeof(char) * MAXWORDNUM);
int y;
for (y = 0; y < MAXWORDNUM; y ++)
{
lines[y] = malloc(sizeof(char) * MAXWORD);
}
Do I need to declare a function
func(char ***lines)
? In my code I created a function in the following way -
func(char *lines[])
and it still works with
**lines
So what is the difference between these two ways? Is it correct to create function func(char *lines[]) for **lines?