Array of C pointers [duplicated]

0

a question I have a doubt if someone can help me. What would be the prototype of a function that receives as parameter an array of pointers? Thank you very much

    
asked by Miguel Gómez 21.04.2018 в 22:44
source

1 answer

1

Taking as an example a function that returns an integer and that receives an array of pointers to objects of any type would be as follows:

int NombreFuncion(void *array[])

or

int NombreFuncion(void **array)

If the array is of pointers of another type of variable, you only need to change the "void" type inside the parentheses, for example for an array of pointers to int:

int NombreFuncion(int *array[])

or

int NombreFuncion(int **array)

I recommend this page where someone explains the topic better: link

  

For example, we will create a table dynamically. To do this, the   pointers to pointers.

     

Let's see the statement of a pointer to pointer:

int **tabla;
     

"table" is a pointer that points to an object of type pointer to int.

    
answered by 22.04.2018 в 06:13