An array of pointers in C (type *arr[N]) is an array whose elements are addresses pointing to other memory locations, such as string literals or dynamically allocated buffers.
Array of Pointers Code Example
#include <stdio.h>
int main(void) {
// Array of 3 char pointers
const char *names[] = {
"Linux Kernel",
"Android AOSP",
"Embedded Yocto"
};
for (int i = 0; i < 3; i++) {
printf("Index %d: Pointer Address = %p, Points to String = "%s"\n",
i, (void*)names[i], names[i]);
}
return 0;
}
Comments and corrections