0

Suppose i write,

char **p;
p[0] = strdup("hello");

Strdup creates a duplicate string in heap with ending character ”; As p is pointer to pointer of char, p[0] = strdup(“hello”) seems perfectly fine for me. But why am i getting segmentation fault.