Please enable JavaScript to view this site.

Navigation: Linkar CLIENTS > C auxiliary Functions

LkFreeMemoryStringArray

Scroll Prev Top Next More

Function to release the dynamic memory assigned by other C functions that return a double pointer char **

 

The C functions that return an array of strings do so by means of a double pointer (char **). In C, this is a pointer that points to an array of pointers, each of which points to a string of characters (a "string").

All this memory (the strings of characters and the array of pointers) has been assigned dynamically. And therefore it must be released when it is no longer needed. This auxiliary function is provided to assist in the release of memory.

 

 

ptr

char**

 

pointer to the memory that must be released

count

uint32_t

 

number of elements (number of character strings)

 

       C