#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main() {
    int size_to_alloc = sizeof(char*) * 1;
    char** p = (char**) malloc(size_to_alloc);
    p[0] = (char*) malloc (sizeof(char) * 10);
    strcpy("hello", p[0]);
    printf("%s\n", p[0]);
}
I am obviously missing something very basic but can't figure out what.
 
     
     
     
     
    