How to declare a pointer that contains char pointer address?

0

The exercise says that last name is an array of pointers to char (char *) and each position contains the memory address of last names.

When I declare the data received in the function, I should write char * last names? (which would contain the addresses) or * int last names? I suppose it should be with char Probably the question is silly, but I'm not sure whether to declare it that way or not.

I mean declare it like this

  

select void (int * statures, char * surnames);

    
asked by Emmaaaaa 28.10.2017 в 04:23
source

1 answer

0

The prototype you propose is the correct one. The type of data that the array will store will be of type (char *) . This said in other words is that each memory section represented by the index of the array will store the address to an element of type char .

Assuming that the last name to be saved is "Ramirez" , and the letter 'R' is stored in the address 0x0A0A05 , and this corresponds to the first element (0) of the array, then the array will contain the following:

apellidos[0] == 0x0A0A05

    
answered by 28.10.2017 / 04:46
source