An array of pointers:

An array of pointers stores addresses of strings.
SYNTAX:

char *names[3] = {"Coke", "Sprite", "Fanta"};
EXAMPLE:

#include <stdio.h>

int main() {

    char *brands[3] = {"Coke", "Sprite", "Fanta"}; 

    printf("%s", brands[0]); 
}
Previous Next